33 lines
903 B
Bash
33 lines
903 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
BLOATING_DOMAINS=$(while IFS= read -r line; do echo "$line"
|
||
|
done <bloating-domains.txt)
|
||
|
|
||
|
# $1 → 0 (mode bloating domains), → 1 (mode requested domains)
|
||
|
bloat_firefox(){
|
||
|
if [ "$1" = 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=$FILTERED_DOMAINS
|
||
|
fi
|
||
|
|
||
|
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"
|
||
|
}
|
||
|
|
||
|
|