Mittwoch, 5. September 2012

Customizing Firefox - Disabling Safe Mode

Some changes for disable safe mode Add-on

If you use selenium tests case with grid component you sometimes get safemode dialogs in firefox. On you can find a great solution to fix that dialogs but this integrated Disable Safe Mode Firefox Add-on seems to not be working with current Firefox Version (15.0).

The reason is, that the "onOK()" method in safeMode.js ( has been removed.

Following changes helped to get it working again.

chrome.manifest (in distribution/bundles/disablesafemode)

content disablesafemode content/

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

safeMode.xul (in distribution/bundles/disablesafemode/content)

<?xml version="1.0" encoding="UTF-8"?>
<overlay xmlns="">
<dialog hidden="true" id="safeModeDialog" onload="onExtra1()"/>

The last change is to copy the content of safeMode.js ( in safeMode.js (in distribution/bundles/disablesafemode/content) an set 

defaultToReset = true //line 12

You can test it by starting Firefox with the -safe-mode parameter or holding down the shift key on Windows or option key on Mac. You'll see the safe mode window show up for a second (sized very small) and then the browser will restart.


  1. Hallo !

    Sind Sie sicher, dass es funktioniert, bei meinen Tests erhalte ich zwar keine Safemode-Dialog mehr, allerdings starte der Fuchs in eben solchem. Nur wenn ich die Shifttaste kurz gedrückt halte, gehts im Norm-Modus, wenn ich diese jedoch "wie blöd" gedrückt halte > Safemode ...

  2. Sorry I'm a total beginner. How and where do I create the "distribution" folder on mac?

    1. Sorry, i am not familiar with Mac but on Windows the distribution folder have to be integrated in Firefox program folder.