如何以编程方式检测 Firefox 的“视图”>“工具栏”菜单中是否启用了特定工具栏
我试图确定 Firefox 的“视图”>“工具栏”菜单中是否已启用特定工具栏(即:可见)。我可以确定是否安装了工具栏(附加组件)。我可以在“工具”>“附加组件”中确定是否启用它。但是,我似乎无法通过“视图”>“工具栏”菜单项检测已安装的工具栏是否实际上已启用/可见。是否有一个配置文件或 sqlite 表来存储我缺少的信息?
I am trying to determine if a particular toolbar is already enabled (meaning: made visible) in Firefox's View>Toolbar menu. I can determine if a toolbar (add-on) is installed. I can determine if it is enabled in Tools>Add-ons. I cannot, however, seem to detect if an installed toolbar is actually enabled/visible vie the View>Toolbars menu item. Is there a config file or sqlite table that stores this info that I am missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 browser.xul 覆盖层的上下文中,使用
...其中toolbar-id 是您感兴趣的
元素的id
。(这就是Firefox 在填充 View > Toolbars 菜单时会执行什么操作,您可以通过在 DOM Inspector 中检查它来找到它,看到它在
popupshowing
处理程序中调用 onViewToolbarsPopupShowing 并查找该函数的源代码: href="http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#4566" rel="nofollow noreferrer">http://mxr.mozilla.org/mozilla- Central/source/browser/base/content/browser.js#4566 )In the context of a browser.xul overlay, use
...where toolbar-id is the
id
of the<toolbar>
element you're interested in.(That's what Firefox does when populating the View > Toolbars menu, which you could find by inspecting it in the DOM Inspector, seeing it calls onViewToolbarsPopupShowing in the
popupshowing
handler and looking up the source for that function: http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#4566 )