![Firefox logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-13-8dda6f.png)
How to detect the presence of menubar from the Firefox extension ?
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
由 Raveendra_Pai 於
被選擇的解決方法
Thanks a lot.. ! This solved my problem.. it works :)
從原來的回覆中察看解決方案 👍 0所有回覆 (2)
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.
選擇的解決方法
Thanks a lot.. ! This solved my problem.. it works :)