Skip to content

Commit 5f1dfa6

Browse files
committed
Support the XDG base directory based default profile path
Starting with Firefox 147, Firefox supports XDG base directory specification
1 parent 0f14e03 commit 5f1dfa6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

updater.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ readIniFile() { # expects one argument: absolute path of profiles.ini
159159
getProfilePath() {
160160
declare -r f1=~/Library/Application\ Support/Firefox/profiles.ini
161161
declare -r f2=~/.mozilla/firefox/profiles.ini
162+
declare -r f3="${XDG_CONFIG_HOME:-"$HOME/.config"}/mozilla/firefox/profiles.ini"
163+
declare -r f4=~/.config/mozilla/firefox/profiles.ini
162164

163165
if [ "$PROFILE_PATH" = false ]; then
164166
PROFILE_PATH="$SCRIPT_DIR"
@@ -167,6 +169,10 @@ getProfilePath() {
167169
readIniFile "$f1" # updates PROFILE_PATH or exits on error
168170
elif [[ -f "$f2" ]]; then
169171
readIniFile "$f2"
172+
elif [[ -f "$f3" ]] && [[ $f3 == /* || $f3 == ~* ]]; then
173+
readIniFile "$f3"
174+
elif [[ -f "$f4" ]]; then
175+
readIniFile "$f4"
170176
else
171177
echo -e "${RED}Error: Sorry, -l is not supported for your OS${NC}"
172178
exit 1

0 commit comments

Comments
 (0)