On MDN, it states here that the element ID for the Bookmarks sidebar is reported by
- CustomizableUI.AREA_BOOKMARKS
Can someone please tell me how I can use that to force Firefox to hide the Bookmarks sidebar? I don't want a "toggle" function because, I need to ignore whichever state it might be in, at the time of the JavaScript call from the loaded HTML page, and force a "hidden", "collapsed" or "not-displayed" mode.
I tried the following as inline scripting, but it did not have the desired effect, likely because I don't have the proper references to tell the browser properly.
<script>
var sidebar = browser.getElementById("CustomizableUI.AREA_BOOKMARKS") ;
sidebar.hide() ;
</script>
I've also tried the following without success:
<script>
browser.action.closePanel ;
browser.action.closeSidebar ;
</script>
Finally, even the specific directive given here does not work:
<script>
browser.sidebarAction.close() ;
</script>
Help, please!
To clarify, this action must work in the new window opened at command line,
firefox -new-window ./myPage.html &
even while a pre-existing browser session is operating with the Bookmarks sidebar open (and staying open).