Skip to content

Instantly share code, notes, and snippets.

@mgwalker
Last active March 29, 2023 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgwalker/f0e35cd3efedde3c092f7e385849d8e7 to your computer and use it in GitHub Desktop.
Save mgwalker/f0e35cd3efedde3c092f7e385849d8e7 to your computer and use it in GitHub Desktop.
Hide the Firefox chrome

Hiding Firefox browser chrome

To hide all of the browser chrome in Firefox, you will need to use the browser console, which is similar to the web console but applies to the whole browser. By default, the browser console is readonly. To enable interpretted commands, you'll need to edit the browser config:

  • navigate to about:config
  • find devtools.chrome.enabled
  • set it to true

Then open the browser console:

  • On MacOS: cmd + shift + J
  • Elsewhere: ctrl + shift + J

And finally, paste in the code below:

(function(){ /*toggle toolbox*/
var doc = Services.wm.getMostRecentWindow("navigator:browser").window.document;
var nt = doc.getElementById("navigator-toolbox");
var ds = nt.style.getPropertyValue("display") == "none";
nt.style.setProperty("display",ds?"-moz-box":"none","important");}
)()

To get the browser chrome back, you can either restart Firefox or run this code in the browser console:

(function(){ /*toggle toolbox*/
var doc = Services.wm.getMostRecentWindow("navigator:browser").window.document;
var nt = doc.getElementById("navigator-toolbox");
var ds = nt.style.getPropertyValue("display") == "";
nt.style.setProperty("display",ds?"-moz-box":"","important");}
)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment