firefoxfirefox-addon

Detect the presence of menubar from Firefox extension


I've written a Firefox extension , that need to know whether menu-bar is present or not. and also need to be notified hide/show of menu-bar ?

How do i do this ? Please help me


Solution

  • Check the autohide attribute of the toolbar-menubar.

    var menubarPresent = document.getElementById("toolbar-menubar").getAtttribute("autohide") === "false" ? true : false
    

    You can get notified of changes through a MutationObserver