How to prevent firefox showing the safe mode dialog after the crash?
It blocks the automatic selenium tests.
How to prevent firefox showing the safe mode dialog after the crash?
It blocks the automatic selenium tests.
I have no idea how you got this and what your testing flow is. So I can't reproduce and test the solution. But Firefox Safe Mode can be disabled by setting the key toolkit.startup.max_resumed_crashes
in about:config
to -1
.
Here's how to start Firefox with that preference set in C# binding:
FirefoxProfile profile = new FirefoxProfile();
profile.SetPreference("toolkit.startup.max_resumed_crashes", "-1");
IWebDriver driver = new FirefoxDriver(profile);
Since Firefox 23, you can also use the environment variable MOZ_DISABLE_AUTO_SAFE_MODE to disable this dialog and the automatic safe mode.
Did you take a look at the configuration options in about:config
, there are options for safebrowsing which might be useful.
The solution by @mmm worked until the recent Tor Browser Bundle (which uses Firefox).
If you need an alternative, you can always delete the line
user_pref("toolkit.startup.recent_crashes", 4);
from prefs.js
, for example like
sed -i '/toolkit\.startup\.recent_crashes/d' /path/to/prefs.js
or call this as
os.system("sed -i '/toolkit\.startup\.recent_crashes/d' " +
os.path.join('/path/to' + 'prefs.js"))