Live preview

This commit is contained in:
Kuba Orlik 2022-04-24 20:04:45 +02:00
parent 2da3ba3e63
commit ae54c490d5
5 changed files with 17 additions and 14 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash -x
#!/bin/bash
INPUT="$1"
ID=$2
@ -10,17 +10,15 @@ unquote(){
URL=$(unquote $(echo $INPUT | jq .url))
DOMAINS=`node array-to-lines.js "$(echo $INPUT | jq .third_party_domains)"`
echo "$DOMAINS"
source ./ephemeral-x.sh
source ./annotate_header.sh
source ./utils.sh
# (while true; do
# grab_screen_to_public $ID
# sleep 1
# done) &
# refresher_pid=$!;
(while true; do
grab_screen_to_public $ID
sleep 1
done) &
refresher_pid=$!;
start_firefox
grab start_firefox
@ -36,8 +34,6 @@ grab open_network_inspector
declare -a pids;
pids=()
echo DOMAINS: "$DOMAINS"
index=0
mkdir -p "/opt/static/$ID"
@ -71,7 +67,7 @@ while IFS= read -r DOMAIN; do
done
done <<< "$DOMAINS"
# kill $refresher_pid;
kill $refresher_pid;
echo "starting wait..."

View File

@ -102,10 +102,9 @@ load_website(){
printf "."
scrot
times=$((times + 1))
if [ $times -eq 60 ]
if [ $times -eq 30 ]
then
echo "Could not load website in time"
exit 1;
echo "Could not load website in time, trying anyway"
break;
fi
done

View File

@ -24,6 +24,10 @@ function attach(docker_id, output_stream) {
output_stream.push(d);
console.log("DATA!", d.toString());
});
task.stderr.on("data", (d) => {
/* output_stream.push(d); */
console.log("STDERR!", d.toString());
});
task.stdout.on("error", (d) => {
output_stream.push(d);
});

4
run.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
docker run -i -v $PWD/static:/opt/static headless-fox ./script3.sh '{"url": "pearson.pl", "third_party_domains": ["hotjar.com", "cookielaw.org"]}' 12345