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?
views:
52answers:
1
+2
Q:
How to detect if a particular toolbar is enabled in Firefox's View>Toolbar menu programatically
+1
A:
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 )
Nickolay
2010-01-18 20:04:09