user.js: override.js file no longer overriding user.js file in FF58+

edit: 1413413 is the cause - Thorin

edit II: I submitted a bug report report (1416279) to hopefully address this - overdodactyl

edit III: bug was labeled WONTFIX

The code that implements this functionality has been removed. After sending an intent to remove email to dev.platform and discussing, we decided that it wasn’t worth the effort of continuing to support as we re-implement the preference service.

edit IV: wiki link


Greetings,

In the past, I’ve been using an override.js file to override some preferences from user.js as suggested in Section 1.5 of the wiki.

Sometime within the past week (maybe two?), the settings in my override.js file are no longer being used to override the user.js file in Firefox Nightly.

I can reproduce this issue in a new Nightly profile, however, if I copy my user.js file and my preferences folder containing override.js to a new profile and use the stable version of Firefox, I do not experience this issue.

Has something changed? Can anyone else confirm they are experiencing this in Nightly (or, alternatively, that they aren’t having the problem)?

I apologize if this has already been addressed…I did a quick search here and on bugzilla and couldn’t find anything relevant .

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 35 (35 by maintainers)

Commits related to this issue

Most upvoted comments

I made myself this batch script (link removed) for Windows. I leave it here in case anyone wants it.

It backs up user.js and then it downloads the user.js file from this repository and appends user-overrides.js to it.

It goes in the profile folder alongside user.js and user-overrides.js.

Thank you for this great resource, by the way. I’ve been using user.js files for a long time but this one is by far the most comprehensive I ever had.

Also thank you @overdodactyl for the heads up.

Hi @earthlng

Thanks for taking the time to do all that, much appreciated!

It’s the least I could do given how much I’ve benefited from this project 😃

@Thorin-Oakenpants

I decided to try and make a version of @claustromaniac’s script usable for fellow Mac users out there . I tried to incorporate all your suggestions from his first version, but I made this before I saw the most recent one. Feel free to use it, make any suggestions/change it however you like or completely ignore it all together. I’m pretty new to writing scripts, so this was a fun use of my time either way 😃

#!/bin/bash

cd "`dirname $0`"

echo
echo "This script should be run from your Firefox profile directory."
echo

if [ -e user.js ]; then	
	echo "Your current user.js file for this profile will be backed up and the latest ghacks version from github will take its place."
	echo
	echo "If currently using the ghacks user.js, please compare versions:"
	
	online_version="$(curl -s https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js | sed -n '4p')"
	local_version="$(sed -n '4p' user.js)"
	
	echo "	Available online: ${online_version}"
	echo "	Currently using:  ${local_version}"
	
else	
	echo "A user.js file does not exist in the current directory.  If you continue, the latest ghacks version from github will be downloaded"
fi
echo
echo "If a user-override.js file exists in this directory, it will be appended to user.js."
echo
read -p "Continue Y/N? " -n 1 -r
echo
echo

if [[ $REPLY =~ ^[Yy]$ ]]; then
	if [ -e user.js ]; then
		#backup current user.js
		mv user.js "user.js.backup.$(date +"%Y-%m-%d_%H%M")"
		echo "Your previous user.js file was backed up: user.js.backup.$(date +"%Y-%m-%d")"
	fi
	
	#download latest ghacks user.js
	echo "downloading latest ghacks user.js file"
	curl -O https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js
	echo "ghacks user.js has been downloaded"
	
	if [ -e user-overrides.js ]; then
		echo "user-overrides.js file found"
		cat user-overrides.js >> user.js
		echo "user-overrides.js has been appended to user.js"
	fi
else
	echo "Process aborted"
fi

I gave up trying to fix the missing !s and ^s, I just can’t get it to work. For user_pref lines in override files there are easy workarounds to keep the lines un-merged, fe by prepending a /* don't merge this */ or simply a TAB. We can mention that in the wiki. Pants and I just have to remember not to use those characters in comments behind user_pref lines.

I need to catch myself up with @claustromaniac - both with improvements to the script and learning to submit pull requests 😃

@overdodactyl For your own good, do not try to catch up. It’s too late for me, but you can still run away. Do it while you still can, before you begin the quick descent into madness.

I enjoy small projects like this once in a while

My words exactly and now I’m stuck here xD Anyway, thanks a lot for contributing

@Thorin-Oakenpants I must admit that I also thought about compiling an exe, but that would bring along the hassle of dependencies and such, right? I mean, for a cross-platform approach we would need something like Python. It would be nice if someone could test @overdodactyl’s script on Linux, though. Since it’s not overly complex it might just work fine on many distros.

@earthlng Good catch. I wouldn’t hope for Firefox to be expecting some people using user.js files made out of chunks of text with different encoding, so I guess we’re indeed better off just avoiding that 😆 It’s good to know that it seems it’s just the BOM header that is leaving trash in the resulting file.

@earthlng, I’m glad I could contribute a bit (even if it was something small)!

Thanks for cleaning up my code a bit, that was my first script of any real value over a couple lines, so I figured it was far from perfect 😃

I noticed in some of my profiles, the script wasn’t locating to the correct directory before running.

I changed cd "dirname $0" to cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd and it seemed to work, but I can’t completely explain why…

On a totally unrelated note, I noticed there was a comma missing on line 25 after 'media.webspeech.recognition.enable' in the script for bulk resetting preferences. (thought it was worth pointing out but not worthy of it’s own issue 😃 )

edit: my bad, fixed the comma - thorin

I tested the Windows batch script and noticed that I got this 1 weird line () in the concatenated user.js due to the BOM header because my user-overrides.js was stored as UTF-8. IDK if that’s a problem when FF will parse the file and/or whether cat on Mac/Linux will also create that line when the 2 files are not in the same encoding. Just something to keep in mind I guess and maybe something that we should add a note about somewhere because some people might use UTF-8 because of foreign language comments in their user-overrides.js. The raw user.js on github is 1252 ANSI latin-1 encoded. Users either need to use ANSI encoding or UTF-8 without the BOM for their user-overrides.js file.

Awesome stuff guys!! Thanks @claustromaniac + @overdodactyl ! ❤️

nits: In the mac (+linux?) version you’re downloading the file twice (not that it matters - just sayin’ 😃 and in certain places it would be better to use && to make sure the previous command succeeded. I would also store the backup filename in a variable so that you can show the actual filename:

#backup current user.js
bakfile="user.js.backup.$(date +"%Y-%m-%d_%H%M")"
mv user.js "${bakfile}" && echo "Your previous user.js file was backed up: ${bakfile}"

Hi @overdodactyl

sorry I couldn’t do more!

you found a problem, informed us about it, reported it to mozilla and provided a script that can be used as a workaround - what more could we ask for! Thanks for taking the time to do all that, much appreciated! ❤️❤️❤️