3

I run a lot of automation using Firefox driver, and it takes a while (20-30 minutes). Naturally, while its running, I continue to work on something else.

However, while I doing things, I occasionally press the Shift key while a new Firefox instance is starting up. However, Firefox has hardcoded that it will boot in safe mode if you are holding shift, which then freezes automation in its "Are you sure you want to boot in safe mode?"

Here's the different options I've considered:

  1. When I first ran into this, I thought that it was an issue with Firefox crashing multiple times. I changed toolkit.startup.max_resumed_crashes to 99999999 and browser.safebrowsing.enabled to false, both manually, and in my FirefoxProfile

  2. I've tried this and this, both of which apparently refer to an old version of firefox, because the files they describe no longer exist.

  3. This doesn't sound like it will work because profiles don't have anything to do with Safe Mode and I can't execute any AutoIt code because Selenium is still maintaining control as its frozen with the popup.

  4. Running Firefox 3.6 or lower is not an option. Running headless is currently in the works (using Phantom), but we'll never stop running it with firefox. The same is true for the Grid (and I like running it local so I can actually see it run).

I've run into this enough times that I'm pretty desperate for any solution...whether that means changing something in my code, firefox settings, some files in the firefox folder, or even some AutoHotKey script (which I've considered, but don't know how it would work).

Thank you!

Community
  • 1
  • 1
Nathan Merrill
  • 7,648
  • 5
  • 37
  • 56

1 Answers1

0

This solution you mentioned seems to work well for me even with the newest Firefox 22.

The omni.ja file is the one you want to unpack. It is a regular zip file.

omni.ja

Inside it:

Inside the omni.ja

Simply unpack, change the file, repack, save. Worked for me.

Community
  • 1
  • 1
Petr Janeček
  • 37,768
  • 12
  • 121
  • 145
  • Ah, I thought it was a .jar file, and I did a search for jar files, which didn't open up. However, I am unable to unzip the .ja file using 7Zip...even after renaming it to .zip You sure its a .zip? – Nathan Merrill Jul 26 '13 at 22:38
  • @MrTi While it's true that one of my programs did have trouble repacking it (while reading from it with no problem), my (licensed :) ) WinRar 4.20 opened and repacked it without any trouble. – Petr Janeček Jul 26 '13 at 22:41
  • By the way, it seems that Firefox purposely broke the zip standard, see https://bugzilla.mozilla.org/show_bug.cgi?id=605524 and http://sourceforge.net/p/sevenzip/discussion/45797/thread/c77c6059 for details. Still, most of zip-capable softwares out there can handle it. It is a ZIP file with an uncommon header. – Petr Janeček Jul 26 '13 at 22:50
  • (also, [it _was_ `omni.jar` before they renamed it to `omni.ja`, because Windows don't backup `.jar` files via system restore](https://bugzilla.mozilla.org/show_bug.cgi?id=701875)) – Petr Janeček Jul 26 '13 at 22:53
  • Ok. I've unzipped, fixed, and then repacked (via windows), and renamed back to .ja. I've created a shortcut with -purgecaches, and then hold shift while opening it..and I still get the safe mode popup. I also still get it if I hold shift while starting up selenium. Could it reverting to some default somewhere because it can't read the zip? – Nathan Merrill Jul 26 '13 at 22:55
  • Yep, that's the issue. Apparently the omni.jar is simply there to speed up start up. While I don't like WinRar, it looks like I'll have to give it a chance – Nathan Merrill Jul 26 '13 at 22:58
  • @MrTi Honestly? No idea. Make sure you made the right change. Make sure you have there the right file and not not the original one. Try ... rebooting, I don't know. It _really_ works for me - I double-checked it now to be sure. Try it once more with a reboot and a check everything is in its place. If it still doesn't work, try to comment at the original solution. – Petr Janeček Jul 26 '13 at 22:59
  • ...and now I feel like an idiot, because it stopped working. AAAARGH. – Petr Janeček Jul 26 '13 at 23:23
  • 1
    Yep. I downloaded that file you had posted for a second, and it doesn't work either. I'll comment on the other question, and leave this question open. – Nathan Merrill Jul 26 '13 at 23:27