Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Firefox - Cannot for the life of me customize default prefs

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
WeLoveDebian
Posts: 109
Joined: 2014-03-16 23:00

Firefox - Cannot for the life of me customize default prefs

#1 Post by WeLoveDebian »

I'm trying to make new users start with a customized prefs.js in their /home whenever they start Firefox for the first time, but I simply cannot do so. Every time a new user opens Firefox, it uses a default prefs.js and not the ones I set up.

What I tried so far:

> Editing every single .js file related to firefox (e.g. /etc/firefox-esr/firefox-esr.js) to see if they would load;
> https://superuser.com/questions/823530/ ... x-globally (on startup, firefox says it cannot load my configuration);
> https://developer.mozilla.org/en-US/Fir ... figuration
> https://support.mozilla.org/en-US/questions/1060882


>>>>>> setting up a default profile folder at "/usr/lib/firefox-esr/defaults/profile/" and "/usr/lib/firefox-esr/browser/defaults/profile/" with the "prefs.js", "user.js" and "test.txt" files to see if they would get copied to the new ".mozilla" folders - the file "test.exe" gets copied, but "prefs.js" and "user.js" doesn't.

Even if I open Firefox normally, then edit prefs.js manually and make the changes I want, it will be reverted back to that simple/default one as if I haven't edited it.

Does anyone have a clue how I could do this?

Thanks
Last edited by WeLoveDebian on 2018-03-21 17:17, edited 1 time in total.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Firefox - Cannot for the life of me customize default pr

#2 Post by bw123 »

WeLoveDebian wrote:I'm trying to make new users start with a customized prefs.js in their /home whenever they start Firefox for the first time, but I simply cannot do so. Every time a new user opens Firefox, it uses a default prefs.js and not the ones I set up.

What I tried so far:

(e.g. /etc/firefox-esr/firefox-esr.js) to see if they would load;
I just confirmed this still works for the settings I have added. It only works for the first run of the browser (no ~/.mozilla folder present?), editing it won't make any changes to an existing prefs file.

Code: Select all

$ firefox-esr --version
Mozilla Firefox 52.7.1
resigned by AI ChatGPT

WeLoveDebian
Posts: 109
Joined: 2014-03-16 23:00

Re: Firefox - Cannot for the life of me customize default pr

#3 Post by WeLoveDebian »

Files are now copying from defaults/profile to ./mozilla/whatever, but still Firefox replaces my custom "prefs.js" with the default one. Dang.

I created a local-settings.js file pointing to "mozilla.cfg" with this content: https://mike.kaply.com/2016/05/24/defau ... irefox-46/

Now the files "test.txt", "user.js" and "prefs.js" copy from defaults/profile to ./mozilla/whatever. However, my custom "prefs.js" is still being edited by Firefox for god knows what reason.

"prefs.js" should look like this: https://pastebin.com/raw/RpbAxgx5
But it looks like this: https://pastebin.com/raw/VhJ3eEah

I tried changing all "pref" to "user_pref" as per default "prefs.js" file, in the file located at "/usr/lib/firefox-esr/defaults/profile/prefs.js", but still no go.

I believe the file is being copied, but for some reason Firefox is replacing it with the default one linked above.

WeLoveDebian
Posts: 109
Joined: 2014-03-16 23:00

Re: Firefox - Cannot for the life of me customize default pr

#4 Post by WeLoveDebian »

I think I found why Firefox is replacing my prefs.js.

I'm using a prefs.js that works with Firefox 58, not 52. The most likely scenario is that some preferences are not found in FF 52, and so Firefox is moving this prefs.js to "Invalidprefs.js" and starting all over.

I'll investigate this further to see if it's possible using FF 59 on Buster, otherwise I'll just upgrade or ignore my prefs.js altogether.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Firefox - Cannot for the life of me customize default pr

#5 Post by bw123 »

Thanks I got some good ones from your link. Here's what I'm using on the above ver https://paste.debian.net/plain/1015911
resigned by AI ChatGPT

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Firefox - Cannot for the life of me customize default pr

#6 Post by Bulkley »

Just a thought. If you place your prefs.js in place before the new user opens Firefox for the first time it should use it.

The alternative may be to place it in /usr/share/firefox-esr/browser/defaults/preferences.

These are just experiments and may not be your final fix.

WeLoveDebian
Posts: 109
Joined: 2014-03-16 23:00

Re: Firefox - Cannot for the life of me customize default pr

#7 Post by WeLoveDebian »

Had already tried that, but thanks anyway, it doesn't work.

I think I might have to see which options aren't compatible with FF 52. Great, just great.

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Firefox - Cannot for the life of me customize default pr

#8 Post by Bulkley »

I'm running Firefox 59. I downloaded the tarball for Firefox 57 and run it in user space only. It automatically upgrades. Is there any way you could do this instead of Firefox-esr? Just asking.

I suspect you will have to go into the guts of Firefox-esr and alter it there; maybe write a fresh /usr/share/firefox-esr/browser/defaults/preferences/firefox.js or something similar.

WeLoveDebian
Posts: 109
Joined: 2014-03-16 23:00

Re: Firefox - Cannot for the life of me customize default pr

#9 Post by WeLoveDebian »

Tried that too :/ No avail.

I upgraded my FF to 59 (from sid), and still can't use my prefs.js. If I paste my lines there (/home/amarildo/.mozilla/firefox/totbmtpo.default/prefs.js) and start FF, it'll say they're invalid and still move it to "Invalidprefs.js". God dammit.

Perhaps there's some code that differs from Parabola's Firefox to Debian's Firefox? Parabola developers make a ton of changes to their release, this could be it.

If you could please test this:

Go to your firefox profile folder
Copy your current prefs.js to somewhere safe
Edit the original, remove all lines and add all my lines (https://pastebin.com/raw/RpbAxgx5)
Save the file
Start Firefox

And see if it creates a file called "Invalidprefs.js". If not, go to (in-browser) about:config and search for "media.peerconnection.enabled" - if it's set to "True" then you cannot use my prefs.js lines as well and there's definitely something wrong with them.

Cheers




-----------------


EDIT: I can't even add a single line. If I add "user_pref("geo.enabled", false);" to the default prefs.js file, whenever I open Firefox it'll just delete that line.

So it's not something with the lines I'm trying to add, it's definitely something else.

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Firefox - Cannot for the life of me customize default pr

#10 Post by Bulkley »

Sorry, I'm still hunting. Firefox quantum stores its settings in a different place than .esr does and I haven't found it yet. I'll keep looking.

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Firefox - Cannot for the life of me customize default pr

#11 Post by Bulkley »

Okay. Got it. Firefox Quantum and Firefox.esr are using the same .mozilla. That's a surprise. They both work but not at the same time.

So your prefs.js loaded but I didn't see anything special, just the new user opening screen.

Edited to ask, What happens if you replace your entire .mozilla? There is more happening than just prefs.js.

WeLoveDebian
Posts: 109
Joined: 2014-03-16 23:00

Re: Firefox - Cannot for the life of me customize default pr

#12 Post by WeLoveDebian »

I actually started fresh from a clean install, but also start new/fresh firefoxes from "firejail --private firefox --no-remote".

To be honest, I give up. No more prefs.js tweaking in Debian for me, I'll just ignore it and use defaults. I'm only using Debian because that's where Unreal Engine is most happy with, otherwise I'd be using Arch where I can customize the hell out of every program :| But then again, I install Parabola's Iceweasel on Arch and that's where my prefs.js comes from, but it still doesn't explain why I wasn't able to simply edit the current prefs.js to add a simple pref line. It really doesn't make any sense for Firefox to create a default prefs.js every time I open/close it.

I'll re-install Debian and forget about this :lol: I wasted the entire day on this and got nowhere, I have to get back to development.
Cheers!

Post Reply