Comments (22)
Good news! I've over-engineered the update process 😅
Free-as-in-mattress for anyone who wants to organize overrides per-section, and is comfortable with make
: https://codeberg.org/oneirophage/firefox-user-js
from betterfox.
Great script! But I still think, that yokoffing should make an official solution to updating and overriding settings in separate file. It would make it way more user friendly and as far as I understand, this user.js is all about delivering privacy in the easiest to use package possible.
from betterfox.
Good consideration. Using that idea, you could create an overrides file and append it to the user.js:
#!/bin/bash
# NOTE: this installs to the default profile directory
# update user.js
curl https://raw.githubusercontent.com/yokoffing/Betterfox/master/user.js > "$(find ~/.mozilla/firefox/ -type d -name "*.default-release")"
# append overrides to file
cat user-overrides.js >> "$(find ~/.mozilla/firefox/ -type d -name "*.default-release")"/user.js
from betterfox.
A simple executable would be awesome for Windows users.
In my case, it'd make it very nice and easy to convince my friends to use Betterfox. "Oh you're using Firefox? Here, try downloading and running Betterfox, it simply makes your experience slightly better."
from betterfox.
Here's a oneliner curl script if you are on Linux. It just overwrites user.js
with the latest version of the script from the GitHub repository:
curl https://raw.githubusercontent.com/yokoffing/Betterfox/master/user.js > "$(find ~/.mozilla/firefox/ -type d -name "*.default-release")"
from betterfox.
Problem with this method is, that it will remove all of my overrides. It could be nice, if your user.js could support user-overrides.js, like in ArkenFox's user.js
from betterfox.
Having a shell script seems to be the best approach. As for the normies who don't know how to run a shell script, having a section in the Wiki would help.
Perhaps we should consolidate Arkenfox's user.js update script for a basis for ours? Some ways we could go about overrides in the user.js are either:
- Having a separate file with overrides and appending that to the user.js file(proposed by me above)
- Extracting user overrides from the old file and insert them into the new file(might be harder to extract)
What do you think is the better approach, or do you have something else in mind?
from betterfox.
Maintaining a shell script for Windows and *Nix wouldn't be too hard. Powershell is a cross platform consideration. Python works too. Judging based off of what yokoffing said previously, it is likely that (Windows) users would need to install the interpreter for the language we choose.
Find Firefox user profile. Is this easy, or is this surprisingly finicky? What if the user installed Firefox on a different disk? (One approach seems to be parsing the file at %APPDATA%\Mozilla\Firefox\profiles.ini or ~/.mozilla/firefox/profiles.ini or
/snap/firefox/common/.mozilla/firefox or */Library/Application Support/Firefox/profiles.ini or ...)
I think a majority of people install Firefox on the same disk as their operating system is on. Perhaps we should make a poll to see if this is something we should consider.
Figure out the version of Firefox
What purpose would detecting browser version be for?
Read the current user.js, and figure out which user.js this corresponds to? (There are multiple versions of Betterfox)
There aren't multiple versions of Betterfox, the other user.js files only contain specific sections of the main user.js.
Download the new user.js
Write the new user.js to the file
Having used Betterfox for a few months now, I'd like to share my updated (Bash) script that accomplishes this:
#!/bin/bash
# fetch betterfox user.js
curl -o user.js https://raw.githubusercontent.com/yokoffing/Betterfox/main/user.js
# append user added settings to user.js
echo '
// your settings/overrides here
' >> user.js
# ensure profiles directory is created
if [ ! -d "~/.mozilla/" ]; then
sleep 5 && killall firefox &
firefox -headless &
wait
fi
# move user.js into firefox default profile directory
mv user.js "$(find ~/.mozilla/firefox/ -type d -name "*.default-release")"
from betterfox.
What are your thoughts on an executable? The concept of running an executable would be familiar for Windows users and we could bundle any dependencies for the tooling we use with it.
There can be multiple Firefox profiles, so that's maybe also worth keeping in mind.
Good consideration.
Every Firefox version has a corresponding version of Betterfox. It'd be weird if the updater could update the Betterfox script before Firefox got around to doing its update.
I forgot about the releases, thank you for pointing that out! We could probably get the version number from the Firefox binary and form a URL with the version number.
And finally, I noticed that I missed an important step: Making a backup of the Firefox profile. The wiki seems to strongly recommend it, so I suppose it'd be useful to have that in an installer script as well. (Of course as a skip-able option.)
Ah that is something I overlooked too.
from betterfox.
Here's a simple batch script I wrote for updating the user.js file
@echo off
powershell invoke-webrequest -uri 'https://github.com/yokoffing/Betterfox/raw/master/user.js' -outfile user.js
pause
I couldn't test so please let me know if it works
from betterfox.
Here's a simple batch script I wrote for updating the user.js file
@echo off powershell invoke-webrequest -uri 'https://github.com/yokoffing/Betterfox/raw/master/user.js' -outfile user.js pause
I couldn't test so please let me know if it works
The script written in PowerShell
invoke-webrequest -uri "https://github.com/yokoffing/Betterfox/raw/master/user.js" -outfile user.js
pause
from betterfox.
Just an FYI, this does not update the script file, it just retrieves a new version. It would be better if the new file could be moved to the profiles directory automatically. It is C:\Users\<username>\Appdata\Roaming\Firefox\<profile-name>
. In my Bash script, I found the profile directory with a wildcard and moved the file there.
from betterfox.
I've had the honor of meeting a handful of Betterfox users in real life. Do you know how many of them would know how to run a script to update their user.js
?
Zero.
I'm aware that we have more advanced users of Betterfox, so an updater would be nice -- but it's also out of scope for the primary audience.
If someone creates a solution, I will happily integrate it and give them credit.
from betterfox.
Having a shell script seems to be the best approach. As for the normies who don't know how to run a shell script, having a section in the Wiki would help.
Perhaps we should consolidate Arkenfox's user.js update script for a basis for ours? Some ways we could go about overrides in the user.js are either:
1. Having a separate file with overrides and appending that to the user.js file(proposed by me above) 2. Extracting user overrides from the old file and insert them into the new file(might be harder to extract)
What do you think is the better approach, or do you have something else in mind?
Just came here to ask the same. I think this would be the best solution with also the least of work?
I was using the Arkenfox user.js and had many issues. Glad I found this one here. Would be awesome to also have the updater 😀
from betterfox.
I've had the honor of meeting a handful of Betterfox users in real life. Do you know how many of them would know how to run a script to update their
user.js
?Zero.
Emm, no? Double click script is easier than modifying user.js, to copy user's overrides.
from betterfox.
There is no need to over-engineer an update process. Replacing the user.js and copying/pasting overrides is easy and simple enough already.
from betterfox.
- It's not over-engineering.
- If it's impossible to make an updater, then it would be nice to at least have separate file for user overrides.
from betterfox.
If you need an updater and a separate file for overrides so badly you can just use arkenfox's 'parrot' nonsense. The less moving parts the project has - the more stable and dependable it is.
from betterfox.
is there a 'updater' for osx
from betterfox.
@alana-glitch Thank you for your work.
from betterfox.
For future people who want to tackle this: How does one best go about this task? Which tech stack? Which things to watch out for?
Tech stack:
- Should be cross platform
- Should be as simple as possible, both for devs and for the end user
e.g. If we go with shell scripts, then we would need to maintain one script for Windows, and one for Linux.
Steps:
- Find Firefox user profile. Is this easy, or is this surprisingly finicky? What if the user installed Firefox on a different disk? (One approach seems to be parsing the file at
%APPDATA%\Mozilla\Firefox\profiles.ini
or~/.mozilla/firefox/profiles.ini
or~/snap/firefox/common/.mozilla/firefox
or*~/Library/Application Support/Firefox/profiles.ini
or ...) - Figure out the version of Firefox
- Read the current
user.js
, this could be used to detect if the user did any changes to the user.js file? - Download the new user.js
- Make a backup of the Firefox profile
- Write the new user.js to the file
What did I miss?
from betterfox.
If we do end up choosing something that requires an extra installation, then it'd be lovely if that were as simple as possible for the end-user.
Python is an excellent example, since installing Python in Windows using the official installer frequently fails. And uninstalling it is equally error-prone.
Meanwhile, if the script starts off by
- Check if Python is installed
- If not, download a binary from PyPy and use that
then the user experience would be near-perfect. The user wouldn't even have to know that the script relies on Python.
I think a majority of people install Firefox on the same disk as their operating system is on. Perhaps we should make a poll to see if this is something we should consider.
There can be multiple Firefox profiles, so that's maybe also worth keeping in mind.
What purpose would detecting browser version be for?
Every Firefox version has a corresponding version of Betterfox. It'd be weird if the updater could update the Betterfox script before Firefox got around to doing its update.
And the second consideration would be that there are multiple Firefox release channels, like Firefox Nightly, Firefox Beta, Firefox ESR.
There aren't multiple versions of Betterfox, the other user.js files only contain specific sections of the main user.js.
Ah, I see. Thank you for clearing that up.
Having used Betterfox for a few months now, I'd like to share my updated (Bash) script that accomplishes this:
On that note, apparently arkenfox's user.js also has a shell script
https://github.com/arkenfox/user.js/blob/master/updater.sh
And finally, I noticed that I missed an important step: Making a backup of the Firefox profile. The wiki seems to strongly recommend it, so I suppose it'd be useful to have that in an installer script as well. (Of course as a skip-able option.)
from betterfox.
Related Issues (20)
- Applying Fastfox.js HOT 11
- How to integrate Smoothfox into user.js ? HOT 2
- Dark mode settings revert to automatic after every restart HOT 1
- Downloads without prompt HOT 2
- Smoothfox.js - parse error quick fix HOT 1
- How to set page zoom with user.js ? HOT 2
- Is there a way to re-enable pocket? HOT 2
- Highlight information using blockquotes
- Smoothfox upgrade: AveYo's Natural Scrolling v4? Why are we still on v3? HOT 3
- Currentness of LibreWolf Overrides HOT 5
- Disqus in "Strict" mode doesn't work HOT 6
- Smoothfox values in quotation marks HOT 1
- Location is not available when i open folder the root directory in about:profiles HOT 3
- Consider tweaking browser.sessionstore.interval HOT 3
- Settings does not save when using betterfox HOT 4
- copying an edited link with the http/s trimmed will not copy the full address HOT 5
- Tab Previews HOT 1
- Disabling Efficiency Mode can greatly improve Firefox performance on Windows 11 HOT 13
- Firefox Weather Widget not being blocked by Betterfox HOT 1
- Bring back old Clear All History dialog HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from betterfox.