Spaces:
Paused
Paused
fix: handle Fetch.requestPaused to allow page navigation through proxy
Browse filesFetch.enable intercepts ALL requests. Must call Fetch.continueRequest
for paused requests, otherwise Chrome shows blank new-tab page.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- register/outlook_register.py +12 -0
register/outlook_register.py
CHANGED
|
@@ -107,7 +107,18 @@ def _setup_proxy_auth(tab, username: str, password: str) -> None:
|
|
| 107 |
"""Register CDP Fetch.authRequired handler for proxy authentication.
|
| 108 |
|
| 109 |
Uses Chrome DevTools Protocol instead of MV2 extensions (deprecated in Chrome 127+).
|
|
|
|
|
|
|
| 110 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
def _on_auth_required(**kwargs):
|
| 112 |
request_id = kwargs.get("requestId")
|
| 113 |
if not request_id:
|
|
@@ -126,6 +137,7 @@ def _setup_proxy_auth(tab, username: str, password: str) -> None:
|
|
| 126 |
except Exception:
|
| 127 |
pass
|
| 128 |
|
|
|
|
| 129 |
tab._driver.set_callback("Fetch.authRequired", _on_auth_required, immediate=True)
|
| 130 |
tab.run_cdp("Fetch.enable", handleAuthRequests=True)
|
| 131 |
|
|
|
|
| 107 |
"""Register CDP Fetch.authRequired handler for proxy authentication.
|
| 108 |
|
| 109 |
Uses Chrome DevTools Protocol instead of MV2 extensions (deprecated in Chrome 127+).
|
| 110 |
+
Fetch.enable intercepts all requests; we must handle both requestPaused (continue)
|
| 111 |
+
and authRequired (provide credentials).
|
| 112 |
"""
|
| 113 |
+
def _on_request_paused(**kwargs):
|
| 114 |
+
request_id = kwargs.get("requestId")
|
| 115 |
+
if not request_id:
|
| 116 |
+
return
|
| 117 |
+
try:
|
| 118 |
+
tab.run_cdp("Fetch.continueRequest", requestId=request_id)
|
| 119 |
+
except Exception:
|
| 120 |
+
pass
|
| 121 |
+
|
| 122 |
def _on_auth_required(**kwargs):
|
| 123 |
request_id = kwargs.get("requestId")
|
| 124 |
if not request_id:
|
|
|
|
| 137 |
except Exception:
|
| 138 |
pass
|
| 139 |
|
| 140 |
+
tab._driver.set_callback("Fetch.requestPaused", _on_request_paused, immediate=True)
|
| 141 |
tab._driver.set_callback("Fetch.authRequired", _on_auth_required, immediate=True)
|
| 142 |
tab.run_cdp("Fetch.enable", handleAuthRequests=True)
|
| 143 |
|