From 4e4340dccdb888de2e1eb1b446f857dc28fe0abf Mon Sep 17 00:00:00 2001 From: ThePhaseless Date: Wed, 7 Oct 2026 00:00:12 +0200 Subject: [PATCH] fix: load plain-http URLs behind a Cloudflare challenge Firefox's HTTPS-First mode upgrades an http:// navigation, sees the challenge's 403 and falls back to http as a fresh navigation. That aborts page.goto() with "interrupted by another navigation", so any http:// URL to a challenged site failed before the solver could run. Co-Authored-By: Claude Opus 5.5 --- src/utils.py | 1 + tests/main_test.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/utils.py b/src/utils.py index 454323a..5d7a94e 100644 --- a/src/utils.py +++ b/src/utils.py @@ -102,6 +102,7 @@ async def get_browser( "devtools.jsonview.enabled": False, "browser.tabs.remote.useCrossOriginOpenerPolicy": False, "browser.tabs.remote.useCrossOriginEmbedderPolicy": False, + "dom.security.https_first": False, }, ) as browser_raw: # InvisiblePlaywright yields a Browser instance diff --git a/tests/main_test.py b/tests/main_test.py index afa003d..06d0ac6 100644 --- a/tests/main_test.py +++ b/tests/main_test.py @@ -25,6 +25,7 @@ test_websites = [ "https://speed.cd/login", 'https://www.yggtorrent.top/engine/search?do=search&order=desc&sort=publish_date&name="UNESCAPED"+"DOUBLEQUOTES"&category=2145', "https://1337x.to/home/", + "http://1337x.to/home/", ]