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.
Related
I have made several scripts for my work as an Accountant that automates many of our daily tasks like downloading some pdfs and mailing them.
This scripts are made with Ruby, Watir and chromedriver.
The main problem that i thought i was going to have is the change in the websites but that was not as problematic as the updates in chrome.
Every time there was a chrome update they changed the flags so i was unable to download pdfs i had to find the appropriate flags and it was fraustrating.
I manage to solve the above problem by creating a new profile of chrome for every script then changing the settings and manually saved them.
But there are at least 50 scripts and everyone needs a different setting for the chromedriver, it starts to get on my nerves.
Except that, I deployed an Ubuntu machine so everything will be more automated and not starting manually the script from my windows machine. Even in there the chromium keeps getting the same changes and eventually when updated it breaks everything.
I thought that the phantomjs could be good but I see that it is dead.
So the main question is do you know any driver that I can use, that hasn't got all the cr#p that the chrome does?
Thanks
To anyone dealing with Watir and Chromedriver or Chrome in general.
It seems that the pref directory_upgrade must be set in order for the chromedriver to download the file.
Also to the ones using watir.
In the latest versions this
prefs = {
download: {
prompt_for_download: false,
default_directory: path,
},
plugins: {
always_open_pdf_externally: true
},
}
must be modified like this
prefs = {
download: {
"prompt_for_download" => false,
"directory_upgrade" => true,
"default_directory" => path,
},
plugins: {
"always_open_pdf_externally" => true
},
}
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.
Previously, I could write an addon for personal usage packed as something.xpi and I clicked on it to install it.
After a while, mozilla introduced xpinstall.signatures.required which you could still get around it.
However, it did not stop stabbing developers who are interested to have a personal addon isolated from the world. Today, only web extensions are working and my XUL based addon is thrown away. The tutorials only talk about temporary installation of a web extension while I want my one runs on firefox forever.
Beside whether I can use web extension to write into files or create a GUI in an independent page, I have a bigger challenge:
How can I install a local web extension permanently without creating a Mozilla account for personal usage?
Navigate to the folder where your extension is located. You can build it in the usual way using web-ext:
web-ext build
You can install this ZIP file permanently in Firefox by going to about:addons and dragging this file into the tab.
In order for this to work, you need to set xpinstall.signatures.required to false in about:config (works only for Nightly and maybe Developer Edition).
Apart from setting xpinstall.signatures.required to false, you need to add this to your manifest.json:
"browser_specific_settings": {
"gecko": {
"id": "some-name#example.org"
}
}
Found on https://www.reddit.com/r/firefox/comments/blqffs/how_to_permanently_add_temporary_addon/exh2u3o/, thanks to "alexherbo2".
You need a "blueish" Firefox -- Developer Edition (effectively beta) or Nightly (unstable, updated every night).
You can get them from https://mozilla.org/firefox/channel/desktop/.
Then xpinstall.signatures.required will work again.
(As for permissions--you can create a GUI in a tab or a popup, but I don't think you can do it in a separate window (unless you do a webpage-style popup window). You won't be able to write to arbitrary files anywhere on the system--which is a good thing! You can write to the Downloads folder, and read/write some sort of internal storage, but that may not expose the actual files involved. For more information see https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Working_with_files.)
What you should be looking for is having your extension signed by Mozilla as Unlisted.
See Mixing Listed and Unlisted Add-ons on addons.mozilla.org blog post for an overview.
That way, AMO does not host nor (normally) review your extension; it simply runs some basic automated checks and immediately signs your extension so that it can be privately distributed as an XPI.
For those interested in developing/running an extension from a local directory without having to package or load it manually via "Load Temporary Addon..." from about:debuggin#/runtime/this-firefox please go to this github repository.
From the README.md:
The procedure involves a few steps, but it needs to be done only once.
First you need to enable AutoConfig aka userchrome.js by copying the file config-prefs.js to [Your Firefox install directory]/defaults/pref
Note: For best security, on Windows it is best to leave your Firefox install in "c:\Program Files" so that your config-prefs.js and userChrome.js can only be modified when you are in root/admin mode.
Then you need to edit the file userChrome.js and modify the function installUnpackedExtensions() to reflect the locations of your own addons.
The modified userChrome.js then must be copied to your Firefox installation directory. For example on Windows this is usually "c:\Program Files (x86)\Mozilla Firefox" for the 32-bit version of Firefox. You can rename the file, but remember to modify the corresponding line pref("general.config.filename", "userChrome.js") in defaults/pref/config-prefs.js
Now your addons from your local directories will be loaded automaticaly whenever Firefox starts. After editing your code remember to reload it from about:debuggin. You can also get there via the menu by selecting "More Tools", then "Remote Debugging", and click on "This Firefox" on the left side (but the quickiest way is to bookmark it and then add a bookmark keyword such as "dbg" for quick access.)
Please note that this is an automated install of the extension every time Firefox starts, so it is not quite the same as a "permenent install". That is, this procedure has exactly the same effect as clicking on "Load Temporary Addon..." from the about:debuggin page, just that the process is now automated via userChrome.js. This means that if you have code that does something after the installation of the extension such as browser.runtime.onInstalled.addListener(details => { if (details.reason == "install") { ...do something after install... }); then this code will be called every time Firefox is launched.
You can try setting the preference extensions.legacy.enabled (this will only work in Nightly or Dev Edition).
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
I want to stop firefox from updating manually
1. Tried to make the app.update.url as empty string, but it doesn't work.
2. Tried installing in some other folder rather than C:/ProgramFiles so that
Automatically Install Updates option is not greyed out in Options>Advanced, but no success.
3. Tried looking at prefs.js but the options which are locked in about:config don't
even appear in that file.
Tired of uninstalling and reinstalling firefox again and again. Does anyone know how to edit locked properties like app.update.auto and app.update.enable in about:config??
I met same problem when I was trying to toggle App.update.enabled which was locked.
There are two places you need to search.
1. Firefox Profile_folder
Firefox installation folder, like %PROGRAMFILES%\Mozilla Firefox
To me, I found below string in one .cfg file, and after modify it, the lock flag gone.
"app.update.auto": {
"value": false,
"locked": true
},
I think it also applies to your problem.
Ref:
http://www.updatefreezer.org/index.php?id=22
http://kb.mozillazine.org/Locking_preferences
https://www.jamf.com/jamf-nation/discussions/13484/deploying-firefox-with-updates-disabled