diff --git a/Docker/bloater.sh b/Docker/bloater.sh new file mode 100755 index 0000000..e7ba8ee --- /dev/null +++ b/Docker/bloater.sh @@ -0,0 +1,35 @@ +#!/bin/bash +BLOATING_DOMAINS=$(cat bloating-domains.txt) + +bloat_firefox(){ + if [ "$#" = 0 ]; then + echo "Bloating Firefox by bloating defined domain list..." + DOMAINS=$(printf '%s\n' "${BLOATING_DOMAINS[@]}") + else + echo "Bloating Firefox by requested domain list..." + DOMAINS=`node filter-requested-domains.js "$(echo $1 | jq .third_party_domains)"` + echo "selected domains" + echo $DOMAINS + fi + + if [ -n "$DOMAINS" ]; then + while IFS= read -r DOMAIN; do + # these domains return a 404 anyways, no need to waste time on them: + if is_http_error "$DOMAIN"; then echo "skipping $DOMAIN"; continue; fi + load_website "$DOMAIN?hl=pl" "$DOMAIN" + sleep 1 # sometimes the consent popup needs a little time + open_console + grab "$DOMAIN before" + (tr '\n' ' ' < click-accept-all.js) | xclip -sel clip + keycombo Control_L v + sleep 0.3 + xdotool key Return + sleep 1.5 + grab "$DOMAIN after" + done <<< "$DOMAINS" + else + echo "No need to blot" + fi +} + + diff --git a/Docker/bloatter.sh b/Docker/bloatter.sh deleted file mode 100755 index be8b65b..0000000 --- a/Docker/bloatter.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -BLOATING_DOMAINS=$(while IFS= read -r line; do echo "$line" -done