fix install_ff_addons
This commit is contained in:
parent
263e00c43e
commit
9b075003d2
1 changed files with 7 additions and 2 deletions
|
@ -238,14 +238,19 @@ installffaddons(){
|
||||||
IFS=' '
|
IFS=' '
|
||||||
sudo -u "$name" mkdir -p "$pdir/extensions/"
|
sudo -u "$name" mkdir -p "$pdir/extensions/"
|
||||||
for addon in $addonlist; do
|
for addon in $addonlist; do
|
||||||
|
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/[^"]*')"
|
addonurl="$(curl --silent "https://addons.mozilla.org/en-US/firefox/addon/${addon}/" | grep -o 'https://addons.mozilla.org/firefox/downloads/file/[^"]*')"
|
||||||
|
fi
|
||||||
file="${addonurl##*/}"
|
file="${addonurl##*/}"
|
||||||
sudo -u "$name" curl -LOs "$addonurl" > "$addontmp/$file"
|
sudo -u "$name" curl -LOs "$addonurl" > "$addontmp/$file"
|
||||||
id="$(unzip -p "$file" manifest.json | grep "\"id\"")"
|
id="$(unzip -p "$file" manifest.json | grep "\"id\"")"
|
||||||
id="${id%\"*}"
|
id="${id%\"*}"
|
||||||
id="${id##*\"}"
|
id="${id##*\"}"
|
||||||
sudo -u "$name" mv "$file" "$pdir/extensions/$id.xpi"
|
mv "$file" "$pdir/extensions/$id.xpi"
|
||||||
done
|
done
|
||||||
|
chown -R "$name:$name" "$pdir/extensions"
|
||||||
# Fix a Vim Vixen bug with dark mode not fixed on upstream:
|
# Fix a Vim Vixen bug with dark mode not fixed on upstream:
|
||||||
sudo -u "$name" mkdir -p "$pdir/chrome"
|
sudo -u "$name" mkdir -p "$pdir/chrome"
|
||||||
[ ! -f "$pdir/chrome/userContent.css" ] && sudo -u "$name" echo ".vimvixen-console-frame { color-scheme: light !important; }
|
[ ! -f "$pdir/chrome/userContent.css" ] && sudo -u "$name" echo ".vimvixen-console-frame { color-scheme: light !important; }
|
||||||
|
|
Loading…
Reference in a new issue