开发者

How to detect if a particular toolbar is enabled in Firefox's View>Toolbar menu programatically

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, howe开发者_如何转开发ver, 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?


In the context of a browser.xul overlay, use

if (document.getElementById("toolbar-id").collapsed) // hidden

...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 )

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜