This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

ابحث في الدعم

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How to detect the presence of menubar from the Firefox extension ?

  • 2 (ردّان اثنان)
  • 1 has this problem
  • 1 view
  • آخر ردّ كتبه Raveendra_Pai

more options

Hi, I have created a firefox extension, that need to detect the presence/absence of the menubar in the browser window. How do i query this from my Extension's javascript ?

Kindly help me in doing so


Thanking you

Raveendra

Hi, I have created a firefox extension, that need to detect the presence/absence of the menubar in the browser window. How do i query this from my Extension's javascript ? Kindly help me in doing so Thanking you Raveendra

Modified by Raveendra_Pai

الحل المُختار

Thanks a lot.. ! This solved my problem.. it works :)

Read this answer in context 👍 0

All Replies (2)

more options

You can check the height of the menu bar.

You can use code like this as a start:

const {classes:Cc,interfaces:Ci} = Components;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
var wd = wm.getMostRecentWindow("navigator:browser").document;
var mb = wd.getElementById('toolbar-menubar');

alert(wd.defaultView.getComputedStyle(mb,"").getPropertyValue('height'));

A good place to ask advice is at the MozillaZine Extension Development forum

The helpers at that forum are more knowledgeable about web development issues.
You need to register at the MozillaZine forum site in order to post at that forum.

more options

الحل المُختار

Thanks a lot.. ! This solved my problem.. it works :)