From 14996e1332976a0174715591f0bf73278af4d8c5 Mon Sep 17 00:00:00 2001 From: pvincent Date: Sun, 14 Mar 2021 00:53:11 +0400 Subject: [PATCH] ublock --- src/main.bash | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.bash b/src/main.bash index 7fb635b..e987507 100755 --- a/src/main.bash +++ b/src/main.bash @@ -59,3 +59,17 @@ else fi +MOZILLA_GLOBAL_ADDONS_FOLDER="/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" +UBLOCK_ADDON="uBlock0@raymondhill.net" +if [[ ! -d "${MOZILLA_GLOBAL_ADDONS_FOLDER}/${UBLOCK_ADDON}" ]]; then + UBLOCK_URL=$(curl -s https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/ | grep -Poe "\"https://addons\.mozilla\.org/firefox/downloads/file.*?\"" | cut -d'"' -f2) + wget ${UBLOCK_URL} -O /tmp/ublock_origin.xpi + mkdir -p ${MOZILLA_GLOBAL_ADDONS_FOLDER}/${UBLOCK_ADDON} + pkexec unzip /tmp/ublock_origin.xpi -d ${MOZILLA_GLOBAL_ADDONS_FOLDER}/${UBLOCK_ADDON}/ +else + echo "ublock origin already installed!" +fi + + + +