diff --git a/Docker/utils.sh b/Docker/utils.sh index 284b1a9..26a440e 100644 --- a/Docker/utils.sh +++ b/Docker/utils.sh @@ -135,16 +135,7 @@ wait_for_pixel_color(){ done } -load_website(){ - URL=$1 - keycombo Control_L l - grab ctrl+l - xdotool type "$URL" - grab type url - xdotool key Return - grab enter - sleep 1 - echo "{\"current_action\": \"waiting for $URL to load...\"}" +wait_for_website_to_load(){ times=0 while [ $(get_pixel_color 143 122) = "#2e3436" ] # the center of the X icon that becomes a "refresh" icon once the website is finished loading do @@ -158,6 +149,23 @@ load_website(){ break; fi done +} + +load_website(){ + URL=$1 + keycombo Control_L l + grab ctrl+l + xdotool type "$URL" + grab type url + xdotool key Return + grab enter + sleep 1 + echo "{\"current_action\": \"waiting for $URL to load...\"}" + wait_for_website_to_load + sleep 0.3 + wait_for_website_to_load + sleep 0.3 + wait_for_website_to_load sleep 5 # sometimes the consent modal needs a little time to show up echo "{\"current_action\": \"website loaded\"}" }