I am using the karma-firefox-launcher plugin to launch my karama tests in Firefox, which works just fine. However every time it launches, Firefox seems to think this is a first-run and it also opens tabs for the privacy notice page, and another one for an extension.
This is what I see every time I run the tests
I was able to make a custom launcher for Firefox in my karma config file to start it in safe mode, like this:
customLaunchers: {
firefox_custom: {
base: 'Firefox',
flags: ["-safe-mode"]
},
},
Which works, but now it shows this dialog every time (which requires the button to be clicked to continue) and is is equally annoying
In my attempt to disable the privacy notice tab, I've tried setting these preferences, but none have worked. Perhaps I'm not setting them correctly?
flags: ["-pref='app.normandy.first_run=false'"]
and
flags: ["-pref='datareporting.policy.firstRunURL='"]
What CLI flags can I set here to both disable extensions without the additional dialog, and stop the privacy
According to the karma-firefox-launcher docs, you can set preferences directly, so after browsing around in the firefox about:config page and searching for "firstrun" I found a preference named toolkit.telemetry.reportingpolicy.firstRun
So, the following will work to prevent that privacy notice tab from opening, but the Adobe Acrobat extension "welcome" tab still opens.
firefox_custom: {
base: 'Firefox',
prefs: {
'toolkit.telemetry.reportingpolicy.firstRun': false,
}
},
It's improved but not all the way there yet! I'll update this answer if I find anything else out.
Related
Scenario: A custom(legacy) app depends on Firefox on Windows. The following Firefox preferences are manually configured at install:[default]
modify: "dom.popup_maximum": [20] 500,
modify: "browser.cache.check_doc_frequency":[3] 1,
create: "dom.successive_dialog_time_limit": 0,
Goal: Update all current Firefox installs to a current version and apply the custom settings using enterprise capabilities. Establish process to manage Firefox for all future installs and updates. Don't break the app.
Problem: These changes can be easily applied individually via about:config. They are not part of the GPO templates and its not clear how to add them or if it can be done. Applying them via policies.json doesn't seem to work either.
On a representative test machine, a directory called \distribution has been created in the same directory as the firefox.exe [standard install, no hanky panky]. The file policies.json exists in the \distribution directory:
{
"policies": {
"Homepage": {
"StartPage": "homepage",
"URL": "https://www.google.com/"
},
"NewTabPage": true,
"DontCheckDefaultBrowser": true,
"Preferences": {
"browser.cache.disk.enable":true,
"dom.popup_maximum": -1,
"dom.successive_dialog_time_limit": 0,
"browser.cache.check_doc_frequency":1
}
}
}
about:policies results
This image shows the results of about:policies. The other settings, used to validate that the policies are working, get applied.
The results from about:config show that the three preferences that I need to affect, have not changed:
dom.popup_maximum;20
browser.cache.check_doc_frequency;3
and dom.successive_dialog_time_limit does not get created.
I believe that these are old preference options. But I also believe that if I can make the changes manually and achieve the desired results, there must be a method to accomplish it programatically.
I think that the best way to change preferences is to use a javascript file that you add to the source code in browser/defaults/preferences where you specify each preference individually.
See here for more information.
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
For testing purpose I tried to switch to offline mode (File > Work offline), and upon refresh, it showed "Firefox is currently in offline mode and can't browse the Web."
When I clicked "Try Again" it went back "Online" again.
How can I work offline to see how my app performing offline?
First check your settings for Firefox.
In Ubuntu, go to
Edit > Preferences > Advanced > Network
Under Offline Web Content and User Data, see how much space is used by Firefox.
If it shows
"Your application cache is currently 0 bytes of disk space",
0 bytes
it probably means you disabled the Firefox offline cache.
Type "about:config" into the address bar and hit Enter, then click the "I'll be careful, I promise!" button and search for these values:
browser.cache.disk.enable user set boolean false
browser.cache.memory.enable user set boolean false
Please refer to Mozilla Firefox support before you do something there.
Mozilla Support
If you are using Firebug, that you may have enabled the Disable Browser Cache option within the Net Panel. Disable that option and try again.
Another issue you may get with FireQuery,
If you see something like
TypeError: this.__FireQueryShared is undefined
remove FireQuery add-on and try again.
I want to debug my firefox extension. I set
javascript.options.showInConsole = true
devtools.chrome.enabled: true
devtools.debugger.remote-enabled: true
run in sdk console cfx run, after that i go to Web Developer -> Browser Toolbox get incoming connection and i see my extension main.js. But after that, the code in main.js already been executed. How to debug it after cfx run?
also, two other things might be messing with your approach:
1) when you use cfx run, that by default creates a new profile on every run, so any settings that you have changed will not persist. to avoid this, you need to specify a profile directory with --profiledir=DIR (warning: don't use your main profile).
2) if the addon main.js code has already run by the time you open the debugger, you should start firefox manually, setup the debugger, and then drag the addon xpi into a tab.
Bug 899054 - [Meta] Implement an Add-on Debugger
this is really close to landing (the UI bits in bug 911098 are in m-c), so if you grab a Nightly tomorrow, or the day after, it should be in there, and might just work (for some undefined value of "work").
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