Skip to content
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

create install script #81

Open
wants to merge 53 commits into
base: main
Choose a base branch
from

Conversation

DanielSGH
Copy link

@DanielSGH DanielSGH commented Feb 9, 2023

  • Check if firefox and git are installed
  • Clone repo
  • Move chrome folder to profile folder root and change about:config prefs
  • Detect profile folder automatically (deducted from files in mozilla/firefox)
  • Add option to uninstall
  • Add support for windows
  • Options for recommended settings (may do in separate PR)

Designed to make the installation a lot simpler, by just using curl to execute the script

README.md Outdated Show resolved Hide resolved
@DanielSGH DanielSGH marked this pull request as ready for review February 11, 2023 00:03
@DanielSGH
Copy link
Author

Might require testing on MacOS, will probably do a Windows .ps1 script later

@DanielSGH
Copy link
Author

DanielSGH commented Feb 17, 2023

@bmFtZQ This is probably all I'll do for now, let me know what you think

Check out #82 (comment) to see how it looks installing on linux, there is also the uninstall feature which I've not shown in that video clip, but you can verify it or I can show you somehow

Copy link
Owner

@bmFtZQ bmFtZQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking so long to respond this!

I already had an update script here but it requires the user to manually enter the profile path.

I think your installation script is better but it has some issues/changes that could be made to improve it:

  • Don't modify prefs.js, instead use the user.js file which can be used to enable options automatically.
  • The commands used to execute the script could be shortened to make installation more convenient (see the file comments for more details).
  • Maybe use curl to download a tarball of the repository instead of using git as it isn't installed by default on most systems. The URL for downloading a tarball of the repo is: https://github.com/bmFtZQ/edge-frfox/archive/refs/heads/main.tar.gz

README.md Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
@DanielSGH
Copy link
Author

@bmFtZQ

Also with the user.js file, if running the script again after installing it, duplicate values will be added to the user.js file as Firefox will never edit user.js. When Firefox is opened, it sets the preferences found in user.js. Removing them from the user.js file later does not remove the preferences from Firefox as they have already been set previously.

The preferences that firefox sets are found in prefs.js, which means they can easily be removed (which sets them to default) provided firefox is closed. Of course, this would mean we also remove the prefs in user.js, because we don't want to set them again.

TL;DR change nothing about how it's currently being installed, but on uninstall, remove prefs in user.js and prefs.js.

The option is there, let me know if you prefer that instead.

@bmFtZQ
Copy link
Owner

bmFtZQ commented Dec 30, 2023

The preferences that firefox sets are found in prefs.js, which means they can easily be removed (which sets them to default) provided firefox is closed. Of course, this would mean we also remove the prefs in user.js, because we don't want to set them again.

TL;DR change nothing about how it's currently being installed, but on uninstall, remove prefs in user.js and prefs.js.

The option is there, let me know if you prefer that instead.

When uninstalling I think removing the preferences should be optional and the script could prompt the user with something like this:

Reset preferences to default values in 'prefs.js' and 'user.js'? [y/N]

Then also create a backup of the existing files before starting (create a copy with .bak added to the end of the filename).

When installing, maybe the script can look in the user.js file for existing preferences and only set the preferences that are needed.

If someone's existing user.js file looked like this:

user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
user_pref("layout.css.color-mix.enabled", true);
user_pref("layout.css.light-dark.enabled", true);

then only user_pref("svg.context-properties.content.enabled", true); would need to be added to the file.

Copy link
Owner

@bmFtZQ bmFtZQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows version works great, though the widget.macos.native-context-menus preference isn't needed there as it would have no effect on Windows.

With the bash script, there are a few changes (mostly related to adding quotes around path names), but also an annoying bug due to differences in the BSD and GNU versions of sed.

install.ps1 Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
@DanielSGH
Copy link
Author

Happy New Year!

@bmFtZQ
Copy link
Owner

bmFtZQ commented Jan 1, 2024

Happy new year!

@DanielSGH
Copy link
Author

@bmFtZQ PR is ready to merge unless you want anything else changed.

@DanielSGH DanielSGH requested a review from bmFtZQ January 9, 2024 20:48
Copy link
Owner

@bmFtZQ bmFtZQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two final changes, first remove/fix the section that asks you if you want to remove preferences. I think it is unnecessary with the option to remove preferences from user.js and prefs.js.

The second change is just adding some new additional preference values. (One for Linux, and one for Windows.)

done;

ans="y"
echo -e "${CYAN}NOTE: enter 'a' to answer 'yes' to all questions.${NC}";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following section does not seem to work in either Linux or macOS it shows the prompt, but then nothing happens. The next line printed to the terminal is uninstall complete.

I think this section can just be removed, deleting the contents of user.js can just be handled by the other section (if the user input yes for that question).

}

$ans = "y"
Write-Host "NOTE: enter 'a' to answer 'yes' to all questions." -ForegroundColor Cyan
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as mentioned in the bash shell script.

$FIREFOX_DIR="$env:APPDATA\Mozilla\Firefox";
$PROFILE_ROOTDIR="$($FIREFOX_DIR)\Profiles\$((Select-String -Path "$($FIREFOX_DIR)\profiles.ini" -Pattern "Path=.*\.(dev-edition-default|default-.*)" | Select-Object -Last 1).Line.Substring(14))";
$OPTIONALS=@{
"browser.theme.dark-private-windows" = "false"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here, add the new optional preference for Windows: browser.theme.windows.accent-color-in-tabs.enabled = true.

PROFILE_ROOTDIR=$FIREFOX_DIR/$(grep -E "Path=.*\.(dev-edition-default|default-.*)" "$FIREFOX_DIR/profiles.ini" | tail -1 | cut -c 6-);
OPTIONALS=(
"widget.macos.native-context-menus" "false"
"browser.theme.dark-private-windows" "false"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in the powershell script, but with widget.gtk.rounded-bottom-corners.enabled = true instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants