Skip to content

Commit

Permalink
Merge pull request #523 from wc7086/patch-1
Browse files Browse the repository at this point in the history
fix install_ff_addons
  • Loading branch information
LukeSmithxyz authored Oct 23, 2023
2 parents c3da3ca + 9b07500 commit 8c2f220
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions static/larbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,19 @@ installffaddons(){
IFS=' '
sudo -u "$name" mkdir -p "$pdir/extensions/"
for addon in $addonlist; do
addonurl="$(curl --silent "https://addons.mozilla.org/en-US/firefox/addon/${addon}/" | grep -o 'https://addons.mozilla.org/firefox/downloads/file/[^"]*')"
if [ "$addon" = "ublock-origin" ]; then
addonurl="$(curl -sL https://api.github.com/repos/gorhill/uBlock/releases/latest | grep -E 'browser_download_url.*\.firefox\.xpi' | cut -d '"' -f 4)"
else
addonurl="$(curl --silent "https://addons.mozilla.org/en-US/firefox/addon/${addon}/" | grep -o 'https://addons.mozilla.org/firefox/downloads/file/[^"]*')"
fi
file="${addonurl##*/}"
sudo -u "$name" curl -LOs "$addonurl" > "$addontmp/$file"
id="$(unzip -p "$file" manifest.json | grep "\"id\"")"
id="${id%\"*}"
id="${id##*\"}"
sudo -u "$name" mv "$file" "$pdir/extensions/$id.xpi"
mv "$file" "$pdir/extensions/$id.xpi"
done
chown -R "$name:$name" "$pdir/extensions"
# Fix a Vim Vixen bug with dark mode not fixed on upstream:
sudo -u "$name" mkdir -p "$pdir/chrome"
[ ! -f "$pdir/chrome/userContent.css" ] && sudo -u "$name" echo ".vimvixen-console-frame { color-scheme: light !important; }
Expand Down

1 comment on commit 8c2f220

@ayushsharma60067
Copy link

Choose a reason for hiding this comment

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

When are posting again sir. PLEASE REPLY.

Please sign in to comment.