user.js icon indicating copy to clipboard operation
user.js copied to clipboard

Updater.sh is not updating user.js

Open Opening-Button-8988 opened this issue 4 years ago • 29 comments

I am using Arch Linux.

When I execute the updater.sh file, it does nothing. When I run it in the terminal, it shows

This script will update to the latest user.js file and append any custom configurations from user-overrides.js. Continue Y/N? 
y
Status: user.js has been backed up and replaced with the latest version!
Status: Override file appended: user-overrides.js

Updater.sh is in the same location as the user-overrides.js, user.js, updater.bat and everything else that was in the zip file.

I know the .sh file is doing nothing because changes I make in user-overrides.js do not reflect to user.js, which is the intended purpose, right? If there's something I'm missing, please let me know.

Opening-Button-8988 avatar Nov 19 '22 09:11 Opening-Button-8988

Hope I am not stating the obvious, but my first thought is have you placed the updater.sh etc in your firefox profile directory (find that location by opening about:support page in firefox).

(EDIT: or you can specify options shown in the help: ./updater.sh -h, such as ./updater.sh -l -o "$(pwd)/user-overrides.js" to choose profile and use overrides file in current directory, or you can specify profile path with -p option)

also add an entry at the end of your user-overrides.js, something like:

user_pref("_user.js.parrot", "SUCCESS: user-overrides.js");

you can check about:config page in firefox for that pref name when you re-open firefox after the script has run.

When you run the updater script look out for any error messages

# change directory to your firefox profile (edit dir name as required)
cd /home/*/.mozilla/firefox/*.default-release
./updater.sh

Other commands that might help you see what's happening:

# list some files (with permissions/size/date shown) (edit as required):

find /home/*/.mozilla -iregex "^.*/\(prefs.js\|user.js\|user-overrides.js\|updater.sh\)$" -printf '%Y %M %u:%g %#6s %TY-%Tm-%Td %TH:%TM:%.2TS %p\n'

# see if overrides are showing on the end of user.js:

tail user.js

icpantsparti2 avatar Nov 19 '22 17:11 icpantsparti2

I too am having this issue. I emptied out my user-overrides to just have user_pref("_user.js.parrot", "SUCCESS: user-overrides.js");

Ran prefsCleaner, then ran updater.sh. All with Firefox closed, all from the correct directory. When I open Firefox and go into about:config, there is nothing showing up for "_user.js.parrot".

I am on Fedora Linux 37.

Edit: Ran `tails user.js" I got:

[xx@xx-laptop p1z6mp9m.default-release]$ sudo tail user.js
user_pref("network.cookie.lifetimePolicy", 2);
// 6012: disable SHA-1 certificates
   // [-] https://bugzilla.mozilla.org/1766687
   // user_pref("security.pki.sha1_enforcement_level", 1); // [DEFAULT: 1]
// ***/

/* END: internal custom pref to test for syntax errors ***/
user_pref("_user.js.parrot", "SUCCESS: No no he's not dead, he's, he's restin'!");

user_pref("_user.js.parrot", "SUCCESS: user-overrides.js");

And nothing is showing up when I go into about:config and search for: "_user.js.parrot".

TheNightRider12 avatar Nov 21 '22 07:11 TheNightRider12

nothing is showing

well it should, because the user.js is riddled with them. You should at the very least get to SUCCESS: No no he's not dead, he's, he's restin'!

or do you mean it's not showing SUCCESS: user-overrides.js?

Thorin-II avatar Nov 21 '22 10:11 Thorin-II

It's not showing anything when I search for "_user.js.parrot". It shows as the options when I search: "Boolean" then "Number" then "String". But no text like the other preferences I search for.

Here is what I see: image

TheNightRider12 avatar Nov 21 '22 18:11 TheNightRider12

In the Firefox profile directory, check file owner/permissions with your file manager, or in terminal with ls -ld . *.js *.sh

If you ran the updater with sudo then the user.js will be root/rw and then would not be loaded by the user you run Firefox under. If that then try running the updater again without sudo: ./updater.sh

icpantsparti2 avatar Nov 21 '22 18:11 icpantsparti2

Updater works fine, more a loading file issue: screenarkenfox

Also backup file is in the backup folder: image

To close 1589

Onf.

Onfroygmx avatar Nov 21 '22 19:11 Onfroygmx

https://github.com/arkenfox/user.js/wiki/3.4-Apply-&-Update-&-Maintain

Put all the relevant files into the root folder of your profile

rusty-snake avatar Nov 21 '22 19:11 rusty-snake

@rusty-snake Yes. I have used user.js before. Everything (updater.sh and prefsCleaner.sh) are in the root directory. I got to that directory by doing into about:profiles finding the currently in use profile, then going into the Root Directory from there. Everything is in there as it should be and has always been.

TheNightRider12 avatar Nov 21 '22 19:11 TheNightRider12

so that's 3 people on linux with FF107 having the same issue where FF doesn't load the user.js?

Can you guys test if it loads a very simple user.js and without using the updater/prefscleaner scripts? something like this fe:

// comment on 1st line

user_pref("_user.js.parrot", "SUCCESS: test test test");

Anyone else have a Linux with FF107 where the user.js is loaded correctly?

I suspect mozilla changed something in their linux release and the user.js isn't loaded correctly or at all.

earthlng avatar Nov 22 '22 19:11 earthlng

Loading of user.js without issue here. Using the updater/prefscleaner scripts, overrides parrot successfull. FF 107 Linux Debian (and Nightly)

2glops avatar Nov 22 '22 19:11 2glops

installed a Fedora 37 VM today and FF107 is not even in the repo yet?!? Anyways, I used the updater to install the user.js and it worked with no problems. The parrot pref (and everything else) showed up in about:config. I have no idea what the problem is. I think you guys will have to figure it out for yourselves, sorry

earthlng avatar Nov 23 '22 16:11 earthlng

FWIW, I just ran arkenfox-cleaner.js, updater and prefscleaner on two machines: one running Linux Mint and the other running Fedora. Multiple FF profiles on each. Actual machines, not VMs. I had no problems at all running anything.

debsidian avatar Nov 23 '22 19:11 debsidian

works4me - Manjaro

i changed a parrot pref in my user-overrides, ran updater.sh, and about:config reflected the change

atomGit avatar Nov 23 '22 20:11 atomGit

Apologies for abandoning this thread. It would work only if I ran the file in the terminal (without sudo). Executing the file in the file manager did not work. Yes, the file is definitely in the right place. It could be file/directory permissions, but if that's the case, why would it work in the terminal without sudo but not in the file manager? It could be something to do with the file manager. I'll revisit this when I have the time.

Opening-Button-8988 avatar Nov 27 '22 10:11 Opening-Button-8988

@Opening-Button-8988, if you execute updater.sh from clicking in a file manager it would not progress past the "Continue Y/N?" confirmation part. However...

(click me) unofficial/unsupported example
You could make another script which calls updater.sh, but you would need to be careful to check that the updater was successful (as you do not see any output info when clicking on it in a file manager).

#!/usr/bin/env bash
# "updater-wrapper.sh" to run arkenfox user.js updater with optional arguments
# you will need to make this executable eg: sudo chmod +x updater-wrapper.sh
# note: for help message listing all "Optional Arguments" run: ./updater.sh -h
./updater.sh -sv

icpantsparti2 avatar Nov 28 '22 02:11 icpantsparti2

@icpantsparti2 So the official method is via the terminal? If so, I'll use execute it in the terminal in the future.

I'm not familiar with bash scripting. Just not that skilled at linux yet. Since the official method is via the terminal, there's not much use for me to use the script, but thanks for letting me know there's a way it can be done in the file manager.

Should I close this thread?

Opening-Button-8988 avatar Nov 28 '22 10:11 Opening-Button-8988

Should I close this thread?

No. I want to wait for #1595 to be evaluated, and depending on what you penguins say, the wiki could do with some better linux instructions

Thorin-II avatar Nov 28 '22 10:11 Thorin-II

Should I close this thread?

No. I want to wait for #1595 to be evaluated, and depending on what you penguins say, the wiki could do with some better linux instructions

After some testing, I have absolutely no idea what was working before, but it is no longer working anymore.

Previously, I would run the updater.sh in the terminal successfully, but it did not reflect any changes to the user.js. Yes, the user.js and user-overrides.js were in the same folder as updater.sh. I moved them to a separate folder in /Downloads/ just in case something weird was going on with Firefox. It was still not reflecting any changes. I played around with permissions, including running the updater.sh as sudo and as a regular user. Neither worked.

EDIT: I tested it on a separate machine running Linux Mint. I still couldn't get it to work. The updater.sh does update user.js with the latest version online, but does not reflect changes made in user-overrides.js. My best guess is that the overrides are actually working but they're being overwritten by the download script, resetting all changes back to the default.

Opening-Button-8988 avatar Nov 30 '22 21:11 Opening-Button-8988

@Opening-Button-8988 - i might suggest starting over because this isn't making sense

first of all, never run anything using sudo unless it's necessary

  1. delete all the arkenfox stuff you downloaded - if you have a user-overrides.js, rename it temporarily
  2. go here and save the user.js to your FF profile where prefs.js is located (Ctr+S to save the file)
  3. go here and save the updater.sh file in the same directory
  4. open a terminal and cd to your FF profile directory: cd "$HOME/.mozilla/firefox/<PROFILE_FOLDER_NAME>"
  5. make updater.sh executable: chmod +x updater.sh
  6. run the updater: ./updater.sh -c
  7. start FF > about:config > search for '_user'

atomGit avatar Nov 30 '22 23:11 atomGit

@atomGit Hi, thanks for responding.

I did all that. I even went to a separate machine (Linux Mint). I downloaded the zip from github, extracted the contents, put the contents in a new profile (root directory). I created a user-overrides.js (as an empty document, thus it is definitely .js), and made changes to the user-overrides.js. I just put something like:

user_pref("browser.startup.page", 1);

Keep in mind, I did everything here. The user.js has 0 specified as default. I ran the updater.sh by right-clicking on it, clicking on "Run in Konsole" (I also tried other terminals). I typed "y" and enter following the prompt. It gave me the results:

Status: user.js has been backed up and replaced with the latest version!
Status: Override file appended: user-overrides.js

Yes, all the files are in the correct place. Yes, updater.sh is executable. I'm aware I only need to run files as sudo if it's necessary, but seeing as the file I wanted to work didn't work, I figured running it as sudo might work, cause that works sometimes. But I also ran it as regular user first, which did not work.

Opening-Button-8988 avatar Nov 30 '22 23:11 Opening-Button-8988