How does Lastpass know the current URL in Chrome

后端 未结 2 1930
闹比i
闹比i 2021-01-12 22:26

When browsing around in Chrome for Android, Lastpass pops up with suggestions if it recognizes the URL as one you have associated login details with.

How does it kno

2条回答
  •  星月不相逢
    2021-01-12 23:18

    LastPass on Android asks for Accessibility permission with canRetrieveWindowContent true. This lets it traverse the current view hierarchy, and access the views as AccessibilityNodeInfo objects.

    Accessibility API lets you search nodes by the text displayed on the view, and also gives you java class name of each such view. AccessibilityNodeInfo#findAccessibilityNodeInfosByText

    The feature doesn't work on Opera probably because the devs never handled the view hierarchy traversing logic for it.

    Check out https://developer.android.com/guide/topics/ui/accessibility/services.html

提交回复
热议问题