如何从 javascript 获取 Google Chrome 中已安装和/或正在运行的扩展程序列表
我正在尝试通过将有关已安装插件和扩展的信息添加到常见的错误、文件、行和(有时)堆栈跟踪详细信息中来改进我们网站上的错误报告代码。
我可以从 window.navigator.plugins 获取插件列表,但是扩展怎么样? 有没有一种干净的方法可以从网站的 JavaScript 中枚举它们?
I'm trying to improve the error reporting code on our site by adding information about installed plugins and extensions to the usual err, file, line and (sometimes) stacktrace details.
I can get a list of plugins from window.navigator.plugins, but how about extensions?
Is there a clean way of enumerating them from within a site's javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,这是不可能的。他们非常小心地将扩展程序彼此隔离,甚至从页面中隔离扩展被注入到中。
如果您担心其他扩展以破坏您的扩展的方式修改 DOM,您也许可以查找相关扩展的症状(例如添加的类名、具有某些类名或 id 的 div),但这基本上是它。
This, to my knowledge, just isn't possible. They're very careful to isolate extensions from each other, and even from pages the extension is injected into.
If you're worried about other extensions modifying the DOM in ways that break your extension, you might be able to look for symptoms of the extension(s) in question (e.g. added classNames, divs with certain classNames or ids), but that's basically it.