gpt4 book ai didi

android - Lastpass 如何知道 Chrome 中的当前 URL

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:08:19 25 4
gpt4 key购买 nike

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

它如何知道 Chrome 正在查看哪个 URL?我知道 Lastpass 使用 Accessibility Services ,但我想知道它如何从 Chrome 查询当前 URL。

附言。显然它只适用于 Chrome(例如它不会在 Opera 中弹出)所以它可能是特定于 Chrome 的东西。

最佳答案

Android 上的 LastPass 请求辅助功能权限,canRetrieveWindowContent 为 true。这允许它遍历当前 View 层次结构,并将 View 作为 AccessibilityNodeInfo 对象访问。

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

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

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

关于android - Lastpass 如何知道 Chrome 中的当前 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41364628/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com