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" id="safeModeDialog" buttons="," ondialogcancel="closeFirefox();"> <script type="application/x-javascript;version=1.7"> <![CDATA[ function closeFirefox() { Components.utils.import("resource://gre/modules/Services.jsm"); Services.startup.quit(Services.startup.eForceQuit); } ]]> </script> <description> Safe Mode has been disabled. </description> </dialog>

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.