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.
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.
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
Related
Long story short:
I tried to create/edit GitHub Gists with
Firefox 67.0 on Windows 10
Firefox 67.0 on Linux Fedora
Add-ons: NoScript, Ghostery, LastPass
Tried with NoScript and Ghostery disabled and also with NoScript in "all shields down" mode and also with Firefox in "safe mode".
Problems:
Creation of a Gist is arbitrary. More often than not, the two buttons "create public gist" and "create secret gist" just stay disabled and the editor widget is "dead".
Occasionally, creation works, the editor widget goes lives and displays line numbers and the editor buttons become active. But it happens annoyingly rarely.
Editing a Gist is arbitrary. Again, it sometimes works but currently I just get blank editor widgets that have no cursor.
Anyone else who has these problems? It may be a temporary hiccup, or maybe there is some JavaScript that Firefox doesn't like. However, a web search brings up nothing - I can't believe I am the only one stuck with this this.
My earlier testing fails completely. I was sure I had tested in safe mode with no change in result.
However I retested with the latest Firefox update (FF 67 on Linux) and found out that it is the LastPass plugin which is the root of the problem. I would not have suspected that.
Disable that plugin, leaving all the others active and Gist creation and Gist editing work.
Enable that plugin and Gist creation and Gist editing work once after a Firefox restart. But after that, you get the unresponsive text entry widget.
Similarly, running Firefox in safe mode with all plugins disabled also fixes the "problem".
And of course, if you do this using Konqueror instead of Firefox, creation/editing work too.
Hope I'm writing that in the relevant platform..
I'm working on a script that analyzing requests while browsing sites with Firefox.
I always see requests to aus4.mozilla.org, even after I changed the "Auto-Update" option in the browser to 'Disable' mode.
Does anybody faced with this problem before? How can I turn it off?
Here is how you can turn off Auto Updates on Firefox from Windows:
Run Regedit in windows (Must have admin right)
Expand HKEY_LOCAL_MACHINE > SOFTWARE > Policies
If the 2 folders Mozilla and Firefox don't exist under 'Policies'. Create them as per the following:
-Right click on "Policies" folder, Select New > Key then enter "Mozilla"
-Right click on "Mozilla" folder, Select New > Key then enter "Firefox"
-Right click on "Firefox" folder, Select New > DWORD (32 bit) value then enter "DisableAppUpdate"
-Double-click on "DisableAppUpdate" to modify Value data to 1 (hexadecimal). This will stop mozilla from downloading and updating Firefox;
It will show "Updates disabled by your system administrator"
To allow Firefox to update again; Modify the Value Data to 0 .
Weird, the option should work.
Double check that the app.update.auto and app.update.enabled configuration options are set to false (you can do that from about:config).
I would suggest using a better method to automate Firefox, for example Selenium. There are bindings for many programming languages, e.g. for Node.js.
Nowadays (65.0.2) disabling updates is relatively complicated. Here's the Windows solution:
In the firefox.exe directory, create one named distribution.
Inside distribution, place a filed named policies.json containing the following:
{
"policies": {
"DisableAppUpdate": true
}
}
Sources:
https://support.mozilla.org/en-US/questions/1232918
https://github.com/mozilla/policy-templates/blob/master/README.md
While I realize this is an older version of Firefox, the system I'm using it on is around 11 years old and it can't take newer versions without the browser and flash content getting sluggish and choppy. This system serves as a public access station and recently I've had someone try to bypass my internet content filters to access material they're not supposed to and they reset Firefox as part of that attempt.
Is truly disabling safe mode possible and if so, how do I easily do this?
If not, I've also read from here...
Disable/Change Firefox Safe Mode Hotkey (Shift)
that disabling the safe mode hot key (Shift key) is possible. At the very bottom, there is a environmental variable that can be used to do this: MOZ_DISABLE_SAFE_MODE_KEY=1. How and where do I insert this variable?
Thank you in advance for your time. :-)
Regards...
Probably too late to help, but maybe this will be of use to fellow Googlers. This blog explains how to disable safe mode in firefox 17, so it may apply to 12 as well:
https://mike.kaply.com/2013/01/11/disabling-safe-mode-in-firefox-17/
If that doesn't help, the regarding the environment variable, that's done from control panel > system > advanced system settings > "advanced" tab > environment variables. You can put the variable in the upper box if you want it to apply to the current user only, or the lower box if you want it to apply to the whole system.
Is there any way to change the firefox shift hotkey that makes firefox start in safe mode? I've set up some unit tests using Selenium and PHPUnit, but if I'm working on the machine while the tests are running then I frequently find I'm pressing shift as I type (holding shift as I select blocks of code is another big offender). This causes the test to fail (and time out) even if you click past the safe mode prompt that pops up.
Is there a way to disable this hot key, or change the key to something that I'd use less often?
I've also met with this problem and didn't find a solution. It seems that it is still an open issue: Mozilla Forums thread, Bug 653410, Bug 644175 and so on. As a workaround you can install firefox 3.6 as this feature was implemented since firefox 4, but probably this will not suite you.
Mozilla finally added an environment variable to control this behavior. Unfortunately, configuring this environment variable in a way that applies to the overall graphical system, rather than merely a bash session, is a bit difficult. This used to be done via /etc/launchd.conf, but macOS dropped support for this in v10.10. Fortunately, systemctl offers a .plist file system which can define run programs and define system-wide environment variables at boot, so I published this working .plist file, with instructions for installing and removing it:
https://github.com/mcandre/dotfiles/blob/master/setenv.MOZ_DISABLE_SAFE_MODE_KEY.plist
This is awesome for me, because I like to launch my web browser from anywhere in the GUI with Control+Alt+G via QuickSilver, which of course includes the Alt modifier that Firefox tends to interpret as signaling safe mode.
Until Bug 653410 is fixed, the best workaround I can come up with is to detect when safe mode is launched and handle it in the best way fit for your particular purposes. This may mean killing the Firefox process and launching again, or it may mean warning the user, or both. When Firefox is launched into safe mode, it writes "LastVersion=Safe Mode" to its compatibility.ini file in its profile directory. An example C# function to watch for this is given below.
FileSystemWatcher safeModeWatcher;
private void watchSafeMode()
{
string profiles = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Mozilla", "Firefox", "Profiles");
string defaultProfile = Directory.GetDirectories(profiles, "*default*")[0];
safeModeWatcher = new FileSystemWatcher(defaultProfile, "compatibility.ini");
safeModeWatcher.NotifyFilter = NotifyFilters.LastWrite;
safeModeWatcher.Changed += delegate(object s, FileSystemEventArgs e)
{
if (File.ReadAllText(e.FullPath).Contains("LastVersion=Safe Mode"))
{
// safe mode!
System.Diagnostics.Trace.WriteLine("safe mode detected!");
// TODO kill Firefox and launch again, or whatever makes sense for you
}
};
safeModeWatcher.EnableRaisingEvents = true;
// ...
// TODO Dispose safeModeWatcher when done
}
I am trying to get selenium tests to run. Yet every time I try to run a tests that should run IE I get a error on line 863 of htmlutils.js It says that I should disable my popup blocker. The thing is I went to IE tools-> turn of popup block.
So it is disabled and I get this error.
Is there something else I need to disable. I actually don't even know what version of Internet explorer it is running since I am using Windows 7 Pro 64bit version. So when I do use IE I use 64bit version but I am under the understanding if the site or something like that does not support 64bit it goes to 32bit.
So not sure what I need to do it to make it work.
This is the lines where it does
function openSeparateApplicationWindow(url, suppressMozillaWarning) {
// resize the Selenium window itself
window.resizeTo(1200, 500);
window.moveTo(window.screenX, 0);
var appWindow = window.open(url + '?start=true', 'selenium_main_app_window');
if (appWindow == null) {
var errorMessage = "Couldn't open app window; is the pop-up blocker enabled?"
LOG.error(errorMessage);
throw new Error("Couldn't open app window; is the pop-up blocker enabled?");
}
Where is this log.error message stored? Maybe I can post that too.
I had a similar problem on Vista and IE8
I would get the same error message
Couldn't open app window; is the pop-up blocker enabled?"
Running my remote control as Admin wasn't an option for me, and also a poor idea from a security perspective.
So in the end I manage to solved this by changeing browser from "*ietha" to "*iexploreproxy"
grid_configuration.yml
hub:
port: 4444
...
- name: "Internet Explorer 8 on Vista"
browser: "*iexploreproxy"
...
Alternatively, you can change browser string from the code:
ISelenium selenium = new DefaultSelenium("localhost", 4444, "*iexploreproxy", "http://www.google.com/");
Works like a charm.
The only question remaing is if this somehow affects the outcome of the test cases. So far no, but I'll update this answer in case that would happen.
I ran into this on Windows 7 64bit.
My solution was:
Disable popup block. - Select "Tools/Popup Blocker/Turn off pop-up blocker"
Disable IE protected mode. - Untick "Tools/Internet Options/Security/Enable protected mode"
It'd be better just to disable protected modes for known trusted hosts/addresses. I'll leave that as an exercise for the reader.
I was experiencing the same problem. I ran the Selenium RC server as an administrator and everything worked fine.
I, too, am experiencing this very problem on a Windows 7 64bit box, trying to run Selenium on it to test and ASP .Net MVC application, written in C#.
I am still trying to work out the answer for myself, but I thought I'd post here to tell you of a little progress I have made in getting something to work, albeit in Firefox instead of IE.
Here's the line I changed:
selenium = new DefaultSelenium("localhost", 4444, "*chrome C:/Program Files (x86)/Mozilla Firefox/firefox.exe", "http://www.bbc.co.uk/");
I would ideally like for this to work in Internet Explorer 8, but if for the moment, I can begin getting tests working and later change over to use IE again, then great.
Hope this helps for your problem with it all.
I had the same problem on Windows 7 64bit IE8. The first step was to disable the IE popup blocker. Then, I got a message in the status bar saying that "Pop-ups were blocked on this page. Press the 'Ctrl' key to allow the pop-ups".
It turns out that the Google Toolbar was providing this feature. Disabling it solved the problem. View > Toolbars > Google to toggle.
John.
If you happen to be doing this from JavaScriptMVC, there is a reference you need to change in \jmvc\plugins\test\drivers\selenium.js:
1) Change iexplore to iexploreproxy and you should get better results:
msie : (/iexploreproxy/i).test(browserStartCommand),
2) At this point, you'll find that you still get the popup error, but a separate instance of IE has started. Leave that IE window open and restart the tests, but not Selenium.
3) Next, the windows should show up in the right place, but IE gives the annoying block active content warning. Allow the content to run and restart the tests, but not Selenium itself.
This is super clunky, but it at least gets you past that part. If I find more methodical ways to do these things I'll update as needed.
I have had the same problem and have found another solution which works for me. Just use the *iexploreproxy setting in the browserString.
I used:
selenium = new DefaultSelenium("localhost", 4444, "*iexploreproxy C:/Program Files/Internet Explorer/iexplorer.exe", "http://www.bbc.co.uk/");
I hope that works for others too :)
You can start the test when you disable the Security mode of Internet. Don´t know the correct name for it, but in dutch it is beveiligde modus.
I tried modifiing the security settings to dublicate this security mode, but couldn´t find the correct setting for it. It must therefor block more then you can set manually.