Add automatic scrolling when headers don't fit on screen - Closes #26

This commit is contained in:
Kuba Orlik 2022-07-14 21:56:47 +02:00
parent 20195f8f6c
commit 6d1f3f2bf1
2 changed files with 30 additions and 9 deletions

View File

@ -62,20 +62,23 @@ while IFS= read -r DOMAIN; do
network_inspector_search "domain:$DOMAIN " # can filter with more granularity: https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/request_list#filtering_by_properties
# grab ni_search
count=0
while network_inspector_has_more_entries
do
filename="$ID/${index}.png"
scrot "/opt/static/$filename"
grab "searching $DOMAIN"
BASE_URL="$BASE_URL" python annotate_header.py "$filename" "$DOMAIN" \
"set-cookie" "identyfikator internetowy z cookie" 11 ""\
"Cookie" "identyfikator internetowy z cookie" 11 ""\
"Referer" "Część mojej historii przeglądania" 0 "$ORIGIN_DOMAIN" &
screenshot_and_annotate "$ID" $index "$DOMAIN" "$ORIGIN_DOMAIN" &
pids+=($!)
network_inspector_next_entry
((index++))
while network_inspector_headers_need_scrolling
do
xdotool mousemove 2400 1000
echo "SCROLLING DOWN"
xdotool click 5 click 5 click 5 # scroll down
sleep 0.1
screenshot_and_annotate "$ID" $index "$DOMAIN" "$ORIGIN_DOMAIN" &
pids+=($!)
((index++))
done
network_inspector_next_entry
((count++))
if [ $count -gt 10 ]; then
break;

View File

@ -223,3 +223,21 @@ network_inspector_next_entry(){
# measure(){
# }
network_inspector_headers_need_scrolling (){
color=$(get_pixel_color 2870 1573)
[ "$color" = "#ededf0" ]
}
screenshot_and_annotate(){
ID=$1
index=$2
DOMAIN=$3
ORIGIN_DOMAIN=$4
filename="$ID/${index}.png"
scrot "/opt/static/$filename"
grab "searching $DOMAIN"
BASE_URL="$BASE_URL" python annotate_header.py "$filename" "$DOMAIN" \
"set-cookie" "identyfikator internetowy z cookie" 11 ""\
"Cookie" "identyfikator internetowy z cookie" 11 ""\
"Referer" "Część mojej historii przeglądania" 0 "$ORIGIN_DOMAIN"
}