From e8f22a1115d2e9f9981f7766bb80dff164fa762b Mon Sep 17 00:00:00 2001 From: Huw Date: Tue, 2 Mar 2021 17:36:53 +0000 Subject: [PATCH] Better slow connection support More tolerance for slow connections when running page down/end detection by waiting slightly longer and nudge the page resize before attempting click left to better tolerate slow page loads with large images or videos on slow connections. --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 5b457b2..94b1c27 100644 --- a/main.go +++ b/main.go @@ -359,7 +359,7 @@ func navToEnd(ctx context.Context) error { break } previousScr = scr - time.Sleep(tick) + time.Sleep(10*tick) } if *verboseFlag { @@ -417,6 +417,9 @@ func doRun(filePath string) error { // navLeft navigates to the next item to the left func navLeft(ctx context.Context) error { + var res []string + chromedp.EvaluateAsDevTools(`window.resize();`, &res) + time.Sleep(tick) muNavWaiting.Lock() listenEvents = true muNavWaiting.Unlock()