Skip to content Skip to sidebar Skip to footer

Hide Location Bar From Firefox Add-on

In my add-on I have an HTML page that gets displayed upon install/update. Firefox obviously shows the chrome:// URI of the page, and I was trying to figure out how to prevent that

Solution 1:

Firefox has a list with URLs where it hides the location bar: http://hg.mozilla.org/mozilla-central/file/f41df039db03/browser/base/content/browser.js#l4146. If you have a browser overlay you should be able to add your own URL to that list:

if (typeofXULBrowserWindow == "object" && XULBrowserWindow.inContentWhitelistinstanceofArray)
  XULBrowserWindow.inContentWhitelist.push("chrome://...");

The checks are meant to ensure that you don't do anything wrong if the Firefox code changes in some future version.

Post a Comment for "Hide Location Bar From Firefox Add-on"