From b7c53aa54f41df7b96eb2a4313e0ba6b75ffc1a8 Mon Sep 17 00:00:00 2001 From: overdodactyl Date: Sat, 14 Apr 2018 13:42:02 -0600 Subject: [PATCH] build webextension mappings from online file --- scripts/internal_UUID_finder.sh | 39 +++++++++++++-------------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/scripts/internal_UUID_finder.sh b/scripts/internal_UUID_finder.sh index a56edb3..d5759a1 100755 --- a/scripts/internal_UUID_finder.sh +++ b/scripts/internal_UUID_finder.sh @@ -2,39 +2,30 @@ ### UUID finder for Mac ## author: @overdodactyl -## version: 1.0 +## version: 1.1 -declare -A styled=( ["brief@mozdev.org"]="brief" - ["CookieAutoDelete@kennydo.com"]="cookie_autodelete" - ["{174b2d58-b983-4501-ab4b-07e71203cb43}"]="dark_mode" - ["jid1-BoFifL9Vbdl2zQ@jetpack"]="decentraleyes" - ["@testpilot-containers"]="multi_account_containers" - ["https-everywhere@eff.org"]="https_everywhere" - ["multipletab@piro.sakura.ne.jp"]="multiple_tab_handler" - ["neaturl@hugsmile.eu"]="neat_url" - ["{73a6fe31-595d-460b-a920-fcc0f8843232}"]="noscript" - ["{1b1e6108-2d88-4f0f-a338-01f9dbcccd6f}"]="request_control" - ["skipredirect@sblask"]="skip_redirect" - ["{b3e677f4-1150-4387-8629-da738260a48e}"]="smart_https" - ["{e225ac78-5e83-484b-a16b-b6ed0924212f}"]="tab_suspender" - ["treestyletab@piro.sakura.ne.jp"]="tree_style_tab" - ["tridactyl.vim@cmcaine.co.uk"]="tridactyl" - ["uBlock0@raymondhill.net"]="ublock_origin" - ["uBO-Scope@raymondhill.net"]="ubo_scope" - ["uMatrix@raymondhill.net"]="umatrix" - ["vim-vixen@i-beam.org"]="vim_vixen" - ["{aecec67f-0d10-4fa7-b7c7-609a2db280cf}"]="violentmonkey" - ["smart-referer@meh.paranoid.pk"]="smart_referer" - ) +## Get current mappings from online repo +webextension_mappings="https://raw.githubusercontent.com/overdodactyl/ShadowFox/master/scripts/webextension_mappings.txt" +web_ex=$(curl -s ${webextension_mappings}) +## declare directory +declare -A styled=() + +## Generate dictionaries from file +while IFS="|" read -r webex_name webex_id; do + styled["$webex_id"]+="$webex_name" +done <"webextensions.txt" + +## Get installed extesnsions from prefs.js line=$(sed -n -e 's/^user_pref("extensions.webextensions.uuids", "{\(.*\).*}");/\1/p' ../prefs.js) +## Write to internal_UUIDs IFS=',' read -ra EXTS <<< "$line" for i in "${EXTS[@]}"; do id=$(echo $i | sed -n 's/.*"\(.*\)\\":.*/\1/p') uuid=$(echo $i | sed -n 's/.*"\(.*\)\\".*/\1/p') if [[ -n "${styled[$id]}" ]] then - echo "${styled[$id]}_UUID=$uuid" >> 'ShadowFox_customization/internal_UUIDs.txt' + echo "${styled[$id]}_UUID=$uuid" >> 'ShadowFox_customization/internal_UUIDs.txt' fi; done