Lastpass如何知道Chrome中的当前网址

mar*_*lar 6 android google-chrome lastpass

在Chrome for Android中浏览时,如果将URL识别为与您关联的登录详细信息,则Lastpass会弹出建议.

它如何知道Chrome正在查看哪个网址?我知道Lastpass使用了辅助功能服务,但我想知道它是如何从Chrome查询当前网址的.

PS.显然它只适用于Chrome(例如,它不会在Opera中弹出),所以它可能是Chrome特有的.

Vib*_*bin 3

Android 上的 LastPass 要求 Accessibility 权限为canRetrieveWindowContenttrue。这允许它遍历当前视图层次结构,并以 AccessibilityNodeInfo 对象的形式访问视图。

Accessibility API 允许您通过视图上显示的文本搜索节点,并且还为您提供每个此类视图的 java 类名称。AccessibilityNodeInfo#findAccessibilityNodeInfosByText

该功能在 Opera 上不起作用,可能是因为开发人员从未处理过它的视图层次结构遍历逻辑。

查看https://developer.android.com/guide/topics/ui/accessibility/services.html