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.