Setting default firefox preferences - firefox

Our continuous integration process uses Selenium, and twice in the last few months it has been knocked out of action thanks to firefox updating itself (either on developer machines or the CI server).
We have therefore installed the previous firefox version alongside the later one (this time in a directory called firefox-16), until Selenium catches up.
The problem is, the app.update.auto setting (in about:config) is set to true by default - meaning that sooner or later it will update itself to 17 and selenium will break. We therefore installed an all-no-update.js file in the /usr/lib/firefox-16/defaults/pref folder containing
user_pref("app.update.auto", false);
which (according to MDN) should override any other values. Unfortunately it doesn't work - the about:config page still shows auto-update as app.update.auto as true. This MDN page says:
All Mozilla-based applications read (application directory)/defaults/preferences/*.js
but unfortunately that doesn't work either - the value stays unchanged.
I've trawled the Bugzilla database but can't find anything relevant (other than the fact that an all.js file gets deleted by an upgrade so be sure to use all-*.js file).
Does anyone know enough about the workings of Mozilla Firefox to tell me how to set this preference value? (please don't say "click on the about:config page" - it needs to be automatically to ensure the build is repeatable and stable).
Thanks, James
Edit:
Sorry if the above isn't clear: I can create default preferences, for newly created profiles, just fine. But as users already have a profile this won't have any effect. I could possibly create a new profile on every machine, for every user, that has this setting disabled - but it is a lot of overhead. Sysadmins all over the world must be using this functionality somehow, surely: a way to override a given preference with a centrally-set one?

The most likely reason is using user_pref() function - as the name already says, this one is reserved for user's preferences (in user's profile), default preferences should use pref() instead.
You also have to consider that whatever you put into this directory are default preferences, they can be overridden in the browser profile (in the file prefs.js there). If you aren't using a clean profile the preference can already be set there and the default won't have any effect then.
For reference: A brief guide to Mozilla preferences

From MDN: Enterprise Deployment (Configuration)
Some config items require lockPref to be set, such as app.update.enabled. It will not work if it set with just pref.
Suspect this may apply to app.update.auto as well. Although I can find no obvious (i.e. named update) configuration option in about:config that is specific to any given add-on. So I don't even know if the per-add-on setting is a pref?

Related

Firefox keeps failing to verify certain apps

Here's the problem. I get a message that pops up that says, "one or more extensions cannot be verified and have been disabled". I know a temporary fix to get these apps working again but the apps always break after so much time. What I do is go in my extensions for my Firefox profile (which is a JSON file) and I use Wordpad to change all the instances of appDisabled": true to appDisabled": false. I also change all the instances of signedState":-1 to signedState":2. The problem is that it keeps changing the false back to true and the 2's back to -1's. I am using Firefox version 56.0.2. Is there any permanent fix that can keep these changes under the current version that I am using? I am getting sick and tired of having to make these changes every day. Also, a couple of key add-ons that I use which are Classic Theme Restorer and unblock Origin keep getting disabling from this issue. I value these add-ons and I would love it if you knew any command prompt that I could put into Wordpad that would make Firefox stop trying to verify add-ons or whatever it does that causes Firefox to disable the add-ons. I welcome any other fix as well. I do want to keep my current version of Firefox and I know the Greasemonkey I use wouldn't work on later versions.
I already tried using Wordpad to change all instances of appDisabled": true to false and signedState":-1 to 2. It would work for a while and then everything reverted back to how it was.
...
appDisabled":true
...
signedState":-1
When appDisabled is true and signedState switches to -1, I get the message saying, "one or more extensions cannot be verified." It also disables the incompatible apps.

Install a personal firefox web extension permanently

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).

Elasticsearch Sense chrome plugin disabled, need to get dsl queries written in console

I am running Google Chrome Version 61.0.3163.100. I previously was running the Sense (Beta) extension version 0.9.4 until Google Chrome flagged it as malware in the extensions tab. The author of Sense has removed it from the Chrome store and it has been rolled into Kibana and renamed Console.
Problem is all the queries I wrote in the Sense console are not retrievable due to the extension being disabled. Previously, every time I opened the Sense (Beta) extension, all my previous queries would be saved and re-displayed each session. I would like to find the file location where Sense stored my queries for redisplay.
I am running Windows 10. I have tried locating my saved data by going to:
C:\Users\Admin\AppData\Local\Google\Chrome\User Data\Default\Extensions
There is nothing identifiable I can find that resembles my old data. Does anyone know where I can retrieve it?
Please download this zip file from my dropbox and follow the instructions to install it. Please run the file through some anti-virus to protect yourself. Thanks to this link to help me export chrome extension.
List item Download and unzip attachment
Go to chrome://extensions
Delete the current Sense plugin installed
Check developer mode and click on "Load unpacked extension..." and select the unzipped folder.
It seems like in the case of the Sense extension, its only persistent data was kept in localStorage (relevant source).
Whether data recovery will be easy depends heavily on when you last used the extension.
If you last used the extension before Chrome 61 (~ September 2017), then you are in luck: the localStorage database is stored in SQLite 3 format.
You need to find the corresponding chrome-extension_[some_id]_0.localstorage file under Local Storage in your profile; it's an SQLite database. The ID doesn't seem to be the same as the extension ID.
You can load it in various tools, including sqliteonline.com for an online browser.
If you need data since update to Chrome 61, you're in a much tougher situation. Chrome 61 switched to LevelDB for localStorage backend, and I couldn't easily extract the data from it.
See this question for subtleties involved. The database itself is located at Local Storage/leveldb in your profile.
It seems like Chrome does not delete older SQLite-formatted data, so you can recover at least data from early September.
FWIW, the ID of the extension appears to have been lhjgkmllcaadmopgmanpapmpjgmfcfig
You can copy your Chrome profile to your ChromiumPortable profile then your Sense extension will be enabled in Chromium with all your history.
Chrome profile
C:\Users\xxxx\AppData\Local\Google\Chrome\User Data\Default
Chromium Profile (rename existing profile to Default.bak)
C:\ChromiumPortable\Data\Chromium\UserData\Default
I had the same problem and the above fix got me my Sense history. I am using Chrome 63 and Chromium 65.
Update: Just updated to Chrome 79, this no longer allows me to load addon.
Just updated my Chrome to 69, It disabled my Sense (beta) addon with a "Malware" message, and I thought I lost all my data. The solution is pretty simple.
Go to chrome://flags/#extension-content-verification flag settings by setting as Enforce Strict, changing it to Bootstrap.
This let me load the extension, and all my saved queries were there.
To identify the extension you need to open chrome://extensions/ and check "Developer mode" (on the top right), then scroll down to the extension and you'll find the Extension's ID.
Folder under C:\Users\Admin\AppData\Local\Google\Chrome\User Data\Default\Extensions will be named with Extensions' IDs.

command line parameters for firefox

I am running program which open "chromium-browser" with following command-line parameters in Linux.
--incognito = Causes the browser to launch directly in incognito mode. ↪
--no-first-run = Skip First Run tasks, whether or not it's actually the First Run. Overridden by kForceFirstRun.
This does not drop the First Run sentinel and thus doesn't prevent first run from occuring the
next time chrome is launched without this flag.
--disable-save-password-bubble
--password-store = Specifies which password store to use (detect, default, gnome, kwallet).
--password-store=basic
--no-default-browser-check = Disables the default browser check. Useful for UI/browser tests where we want to avoid having
the default browser info-bar displayed.
--window-size = Specify the initial window size: --window-size=w,h
--window-size=1024,1024
--app = Specifies that the associated value should be launched in "application" mode.
Now I want to do the same thing with "firefox" browser. I need help to find firefox command-line parameter for firefox which is similar to chromium-browser.
I searched firefox website but not able to find alternatives for same.
Try to look them up here Mozilla - Command Line Options remember: Mozilla is the umbrella organisation of firefox, thunderbird, ... so this looks like the normative documentation place - the reality check then will be the installed binary, but then you can file issues in the tracker (if an option similar to these needed by you is documented but does not work).
Update 2021-08-30: Note that the options page is in archive status and there may be non-listed options available or listed options missing with newer versions. Until the Mozilla / Firefox project comes up with a maintained manual page on these options a good way to ensure what options are supported is to call firefox on the command line with the --help parameter.
You can try to check this one
this works as of 21/10/21
You would also want to look at the '-kiosk' argument
(similar to the chromium '--app' arg) which isn't really documented in the pages referenced in other comments here.
https://support.mozilla.org/en-US/kb/firefox-enterprise-kiosk-mode

PortableApps.com application Prompts to update even after updating the firefox portable?

Every time PortableApps.com checks for the update Even if you update the application (Ex. Firefox) inside the application settings (Help->About).
How can we avoid this since I am already updated the application?
PortableApps.com application have the product version inside the respective config file which is not changing automatically while the application (Ex. Firefox) is update itself.
Another thing is if you are updating from Firefox 35.0 to 35.0.1 then the update only needs 3 MB but if you are using the above app then you have to download the entire Firefox app (41 MB) from internet. It is annoying rite?
To avoid this change the config file manually as mentioned below.
Go to PortableApps\FirefoxPortable\App\AppInfo
Open "appinfo.ini" file
Move to version section and see the PackageVersion (35.0.0.0)
This should be changed to 35.0.1.0
Thats all. Next time you will not be prompted to update the Firefox.
Note : You may use the same technique across the other PortableApps.com applications.

Resources