给 nodriver 当前浏览器实例补一层断连降噪与异常透传。
(browser_instance=None)
| 985 | |
| 986 | |
| 987 | def _patch_nodriver_runtime(browser_instance=None): |
| 988 | """给 nodriver 当前浏览器实例补一层断连降噪与异常透传。""" |
| 989 | global _NODRIVER_RUNTIME_PATCHED |
| 990 | |
| 991 | if not NODRIVER_AVAILABLE or uc is None: |
| 992 | return |
| 993 | |
| 994 | if browser_instance is not None: |
| 995 | _patch_nodriver_browser_instance(browser_instance) |
| 996 | |
| 997 | if not _NODRIVER_RUNTIME_PATCHED: |
| 998 | _NODRIVER_RUNTIME_PATCHED = True |
| 999 | debug_logger.log_info("[BrowserCaptcha] 已启用 nodriver 运行态安全补丁") |
| 1000 | |
| 1001 | |
| 1002 | def _parse_proxy_url(proxy_url: str): |
no test coverage detected