Disabling Safe Mode (Again)

It’s no longer possible to disable safe mode after Firefox 39 because of the removal of the distribution directory.

So lots of people are having trouble disabling safe mode using my earlier instructions and I discovered it is because of problems overlaying the dialog. So here are some new instructions that should work for everyone.

First, create a disablesafemode directory in distribution/bundles where the Firefox executable is located (you’ll probable have to create the distribution and bundles directories as well). Then create a file called chrome.manifest that looks like this:

content disablesafemode content/
override chrome://browser/content/safeMode.xul chrome://disablesafemode/content/safeMode.xul

Then create a subdirectory called content. In that directory, create a file called safeMode.xul that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/"?>
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  <script type="application/x-javascript;version=1.7">
  function closeFirefox() {
  Safe Mode has been disabled.

This will cause a dialog to be shown instead of the safe mode dialog that when the user closes, will simply close Firefox. If you’d prefer to show no dialog at all, change ondialogcancel to onload.

I’ve tested this a lot, and it is working for me. Please let me know if you have problems.

Please note: I reserve the right to delete comments that are offensive or off-topic.

Leave a Reply

Your email address will not be published. Required fields are marked *

30 thoughts on “Disabling Safe Mode (Again)

  1. Hello Mike! Again, great post.

    I tried this as of August 16, with Firefox version 23 for Windows 7.

    It’s working like a charm. Just followed your instructions above.

    Thanks for keeping us safe. 😀

  2. Hello Mike, I’ve tried disabling Safe Mode on several computers.

    I noticed when I upgraded my firefox to 23.0.1 – it’s NOT working.

    I downloaded the Firefox Installer ~275kb in the website as of Aug. 19, 2013 today, and it upgraded firefox to 23.0.1. then I tried your method above, but it’s NOT working.

    Safe mode launches and there’s a dialog box.

    However, in some of my computers, I installed it same method as above it’s working. That’s really weird.

    Is the problem in my computers? I restarted a lot. I’ll investigate further.

    • Yes, it works on a Mac.

      It can’t actually be an add-on – that’s why the instructions are here. It has to be files in the distribution directory.

  3. Hello Mike, thanks for sharing all this wonderful tips with Firefox.

    But I have a question. I’m also using Thunderbird for my email client, and so far it’s very fast and efficient.

    Is there a way to also disable the Safe-Mode feature of that program?

    Hope you could help. Thanks.

  4. trying this out on firefox 30 on Solaris (I know). Anyways, it seems to close the window, but leaves firefox running in a windowloess state. Thus a user attempt to restart firefox manually results in “firefox already running” message. please help.

    • Odd. It sounds like it’s not running the code to restart Firefox. I’ll see if I can recreate on Linux. I can’t make any promises though.

  5. Mozilla Firefox/distribution/bundles/disablesafemode /content/safeMode.xul


    Mozilla Firefox/chrome.manifest

    That doesn’t work. I mean it does prevent safe mode, which I suppose is sufficient; but no box pops up, and basically glitches out. Windows 7. Firefox 38.0.

  6. Hey mike.

    AWESOME. and there is totally a use case for it… like public libraries and church!

    please keep up the good work.
    got it running with the current firefox ESR (still in 38.4) but the script won’t quite run. running lubuntu 14.0.4 and installed the ESR in /opt then put the chrome.manifest in the root of the binary directory, and created the subfolders as specified. as another person said it stops safe mode, which is sufficient, but if someone is trying to be crafty and appends the shortcut with -safe-mode (as opposed to command line where you can ctrl c out) it’ll keep spinning and requires a reboot before the browser will work since it’s already running.

    never even see a dialogue so it’s right there at the beginning

    very awesome job and thank you again, just a minor complaint if youve got some wizardry up your sleeve. fingers crossed for the next ESR at least

    • I’m starting to wonder if there’s just something strange about Linux windowing that won’t let this work. I’ll do some more checking.

      • Hi,

        Sorry for resurrecting such an old comment, but I has been looking for a way to do this in Linux for a long time until I found this post. Unfortunately, the link is not alive any more.

        Would it be possible to reshare it again?

        Many thanks in advance!


        • What version of Firefox? Unfortunately Firefox got rid of distribution/bundles, so this is not as easy to do, but if you use the CCK2 you can disable safe mode.

    • And make sure you remove the chrome.manifest from where the Firefox executable is. There should only be one in the browser subdirectory.

      • Is this meant to work for Firefox 43.0.4? I followed the above steps, without success. Is the Firefox executable (I assume this to be the application icon) supposed to be located inside the new directory “distribution”, or just in the same main directory?

  7. Excellent post. I was checking constantly this weblog and I’m inspired!

    Extremely helpful info particularly the closing phase 🙂 I
    take care of such info much. I used to be seeking this certain info for a long
    time. Thank you and best of luck.