4

I am using Windows 7 and I've been playing with the Firefox browser for a while. I want to create a kiosk app using it, I installed a plugin for that, but the problem is that when I start the Firefox app, if I press Shift, it enters safe mode.

I read some guides on Google that tell me to edit chrome/browser.jar but I have no such file in my Firefox folder.

I need some help for disabling the feature that lets me enter safe mode by pressing Shift.

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
NVG
  • 3,248
  • 10
  • 40
  • 60

2 Answers2

5

You cannot really disable safe mode by editing text files, the handling of the Shift key is inside compiled code. You can however disable the dialog that pops up by removing this code from components/nsBrowserGlue.js:

// check if we're in safe mode
if (Services.appinfo.inSafeMode) {
  Services.ww.openWindow(null, "chrome://browser/content/safeMode.xul", 
                         "_blank", "chrome,centerscreen,modal,resizable=no", null);
}

You can also leave extensions enabled in safe mode. For that you will have to also edit modules/XPIProvider.jsm and remove all occurrences of code like:

if (Services.appinfo.inSafeMode)
  return false;

Both files can be found inside the onmi.ja archive in the Firefox directory.

That said, the proper solution to this problem would be running your own application on top of XULRunner which would allow you to design your own user interface for kiosk mode. Sadly, Open Kiosk (which is probably what you are using) is ancient and predates XULRunner.

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
  • Im using R-KIOSK addon . So I should get the FIREFOX SOURCE CODES, edit "components/nsBrowserGlue.js", compile them and I would have my copy without SAFE MODE ? – NVG May 22 '12 at 20:59
  • Please [stop abusing the shift key](http://www.kassj.com/netiquette/netiquette.html#1). You can change the files inside `omni.ja`, it is a regular ZIP archive - no need to recompile Firefox for that. – Wladimir Palant May 22 '12 at 21:07
  • thanks for telling me about the ZIP fact, i managed to extract it and im editing the files you mentioned. – NVG May 22 '12 at 21:14
  • so I changed omni.ja to omni.zip , unpacked, edited the files above , repacked correctly, changed filename to .ja , then when I try to run my firefox copy , i can disable the addons and I can start in SAFE MODE by abusing SHIFT KEY - it's like I did no changes – NVG May 22 '12 at 21:20
  • @nevergone: You should use [`-purgecaches` command line flag](https://developer.mozilla.org/en/Setting_up_extension_development_environment#Development_command_flags). – Wladimir Palant May 24 '12 at 06:38
  • I know I'm resurrecting the dead, but it looks like this solution no longer works. After following all of the above comments, firefox still starts in safe mode. Any other ideas? – Nathan Merrill Jul 26 '13 at 23:28
0

I managed to disable Firefox session restore and safe mode tweaking these two preferences:

browser.sessionstore.resume_from_crash  => false
toolkit.startup.max_resumed_crashes     => -1
Daniel Reis
  • 12,944
  • 6
  • 43
  • 71
  • This does not prevent you from entering savemode using the shift key. – Gerhard Sep 23 '14 at 14:27
  • Yes, you're right, not the answer to the exact question made. I hope it's still useful for cases where the problem is cumulative power failures. – Daniel Reis Sep 23 '14 at 17:12