-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
override.js file no longer overriding user.js file in FF58+ #264
Comments
Thanks for the reply @Thorin-Oakenpants, I'll take a closer look at bugzilla and report back with anything I find! Hopefully it wasn't removed on purpose...I've been relying on that :) |
Thank you @Thorin-Oakenpants!! I appreciate the advice and you looking into that...I'm not super familiar with bugzilla, so any new tips like that are really helpful :) I'm glad a tickets already been submitted (one that I obviously missed). I don' have too many overrides either, so throwing them at the end of Thanks again! |
Thanks for updating the wiki page! I noticed that was for Thunderbird...I guess I just naively thought the ticket might include Firefox haha. You're right though, that doesn't look super promising. I can go ahead and submit a new ticket if you think it would be helpful. |
I went ahead and submitted a bug report this morning 1416279 for anyone that wants to follow it. Edit: Was labeled as WONTFIX...I guess there's no hope after all :(
|
No problem @Thorin-Oakenpants, sorry I couldn't do more! If it helps anyone else out there, a viable alternative (at least for me) is to use something like the following script:
it at least quickens the process of keeping up-to-date and could be easily modified to use various |
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! ❤️❤️❤️ |
I made myself 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. |
@Thorin-Oakenpants I improved it a bit with your ideas, and I changed a few things. If Other significant change is that now it doesn't rely on the existence of I guess there's still room for improvements, so let me know what you think. Edit: Last-minute minor fix 😓 |
Hi @earthlng
It's the least I could do given how much I've benefited from this project :) 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 |
Awesome stuff guys!! Thanks @claustromaniac + @overdodactyl ! ❤️ nits: #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}" |
I tested the Windows batch script and noticed that I got this 1 weird line ( |
https://github.com/ghacksuserjs/ghacks-user.js/blob/master/updater.bat This will help users a lot, thanks guys!! |
@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 On a totally unrelated note, I noticed there was a comma missing on line 25 after edit: my bad, fixed the comma - thorin |
@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 |
@overdodactyl |
So... I made some further changes and additions to the batch script. 😸
As you might have guessed, the I'm quite satisfied with it as it is now, but please make suggestions/requests/observations if you have any. EDIT: Fixed the new logging feature messing with the script output when disabled 🤦♂️ |
#264 (comment) - It can now handle read-only files. - it is somewhat more explicit regarding what it's doing in some circumstances. For example, it now informs the user when no changes are made. - It now accepts two parameters: `-unattended` and `-log` - Minor improvements here and there.
Very nice changes. I've reviewed + tested it and can confirm it works as advertised :) 👍 |
I finally taught myself to open pull requests and just opened one to change some minor details that I noticed today lol I enjoy small projects like this once in a while, so it's been my pleasure, really. I'm the one who is grateful for all that you guys do for us here. |
My words exactly and now I'm stuck here xD Anyway, thanks a lot for contributing |
Some other potential improvements I've come up with that may be worth considering:
|
I like this one. Like fe. (re-)create the user-overrides.js from all the .js files in the preferences folder. That would be neat. The other ideas sound complicated to implement, fe re: changelog - you already end up with a new user.js and the backup and can simply compare the 2 to see all the changes. |
Actually, I was thinking more of something like appending all user-something.js files to user.js alphabetically, without modifying any other files, because user.js is the only one Firefox cares about. It would mean that you can have as many separate override files as you want and they will all count. Maybe a mix of both concepts could be achieved if the script merged all js files in a specific subfolder into a new user-overrides.js file and then appended that one to user.js, but then user-overrides.js would be redundant.
The point of having the script bring up a changelog upon completion would be simply automation, and it would go hand in hand with the option to run it unattended. But you are right. It's probably not worth it. As for some of my other ideas:
Apparently, the task scheduler can hide the console window when both the Run whether user is logged on or not and Hidden options are selected. A great reason to not even bother.
The logic goes like this: Introducing an updater means taking away some of the hassle of updating files, but it isn't all that much beneficial if you now have to manually update the updater. Ideally, one would simply write a functional updater and leave it alone, but you never really know if the future will demand making further changes to it or not. What I can't make up my mind about is the how(s). I mean, there are many ways to code it, but when should the updater attempt to update itself? Should it be optional? How? EDIT: I can't help but feel a little bit like this while I think of all this. Just a little bit. |
I apologize for the delayed response, I've been away from the computer for the past several days. The only issue with using
Does the approach mentioned in my previous comment ( Thanks for the invite!! I need to catch myself up with @claustromaniac - both with improvements to the script and learning to submit pull requests :) Edit: Here is a link discussing readlink/greadlink on a mac: http://biercoff.com/fixing-readlink-illegal-option-f-error-on-a-mac/ |
LOL, so true! I feel like that a lot xD
If someone has multiple js overrides I just think it would be nicer to have them all in a subfolder.
oh okay, that's not great. I think it needs some sort of readlink command to work in all cases. I don't think your suggested code does that. From what I remember there can be problems if you call it with |
... at fixing the script path detection. should hopefully fix #264 (comment)
@overdodactyl can you test if the change in my PR works for you, please? PR: #284 |
... at fixing the script path detection. should hopefully fix #264 (comment)
Your PR adds a function realpath_osx() but calls realpath. (?) |
I was just looking into what you mentioned earlier with
Sounds like it might get a little whacky with the use of symlinks?
My mistake. When I was testing it I used |
@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 haven't tested the latest version of my script exhaustively, so I might have missed something. Be sure to let me know if you guys find anything odd, or if you'd like me to explain in more detail how it works. I know the code itself is awful to read, but that was part of the charm. I don't have too much experience with batch scripts, so it was a fun challenge. |
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 |
@earthlng I see a lot has been going on while I wasn't looking heh. I still haven't given up on that. To be honest, I didn't have time to test what I wanted to test yet. As for the loopìng auto-update part, it's pretty easy to fix. I'll submit another PR soon (hopefully). |
If you have a user-overrides.js and run the script without any parameters it will simply append your overrides to the end of the user.js. If you instead have multiple override .js files in profile/preferences you can rename that folder to user.js-overrides and run the script with the -multioverrides switch and it will append all those files to the end of the user.js. And then there's the -merge switch which will do an in-place replacement of active user_pref lines. for example the original user.js has a line user_pref("whatever", true); and the user-overrides.js has user_pref("whatever", false); /* 1234 */ with -merge, the final user.js will have that line replaced with the exact line from the overrides.
yes. But if someone wants to use the -merge switch and also likes to have comments with !s or ^s, they can either add a TAB or a JS-multi-line comment in front of the user_pref line, fe. /* don't merge this */ user_pref("whatever", false); // !!! THIS NEEDS TO BE FALSE, WTF !!! This will keep that line at the bottom of the user.js, together with any other overrides that didn't get merged, for example because a certain pref does not exist or is inactive in the user.js. user.js.parrot lines are NOT merged and can contain those 2 characters. All we have to do, is not use |
@earthlng Actually, after some testing and reading I found out carets ( ^ ) are unaffected. The issue with exclamation marks is that they are removed if found anywhere in user_pref lines (except I still haven't had any luck fixing it. |
Yeah I don't think we need to bother with trying to fix it, we'll just note it in the wiki. |
arkenfox/user.js#264 (comment) - It can now handle read-only files. - it is somewhat more explicit regarding what it's doing in some circumstances. For example, it now informs the user when no changes are made. - It now accepts two parameters: `-unattended` and `-log` - Minor improvements here and there.
... at fixing the script path detection. should hopefully fix arkenfox/user.js#264 (comment)
arkenfox/user.js#264 (comment) - It can now handle read-only files. - it is somewhat more explicit regarding what it's doing in some circumstances. For example, it now informs the user when no changes are made. - It now accepts two parameters: `-unattended` and `-log` - Minor improvements here and there.
... at fixing the script path detection. should hopefully fix arkenfox/user.js#264 (comment)
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
edit IV: wiki link
Greetings,
In the past, I've been using an
override.js
file to override some preferences fromuser.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 .
The text was updated successfully, but these errors were encountered: