Lastpass如何知道Chrome中的当前网址 [英] How does Lastpass know the current URL in Chrome

查看:149
本文介绍了Lastpass如何知道Chrome中的当前网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是如何知道哪个Chrome浏览器正在查看?我知道Lastpass使用辅助功能服务,但我想知道它会从Chrome查询当前的URL。



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

> Android上的LastPass通过 canRetrieveWindowContent true来请求访问权限。这让它遍历当前视图层次结构,并以AccessibilityNodeInfo对象的形式访问视图。

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



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



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

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 know which URL Chrome is looking at? I know that Lastpass makes use of Accessibility Services, but I wonder how it queries the current URL from Chrome.

PS. Apparently it only works for Chrome (it doesn't pop up in Opera for example) so it might be something Chrome specific.

解决方案

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

这篇关于Lastpass如何知道Chrome中的当前网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆