eaa1469143
Testing / test (push) Successful in 26s
Testing / remote-protocol-compat (0.9.3) (push) Successful in 27s
Testing / remote-protocol-compat (0.9.5) (push) Successful in 20s
Package Extension / package-extension (push) Successful in 28s
Build & Publish Package / publish (push) Successful in 31s
- Add shared browser error URL detection for Chrome, Edge, Brave, and Firefox-style about:error pages. - Short-circuit read-only DOM and HTML commands with safe fallbacks when tabs are already on browser error pages. - Fail navigation waits, DOM waits, polling, and URL watches with clearer error-page messages. - Bump package and extension version to 0.9.8 and extend regression coverage for cross-browser error-page handling.
38 lines
1.4 KiB
Python
38 lines
1.4 KiB
Python
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
def test_extension_retries_error_page_script_injection_before_failing():
|
|
core = (ROOT / "extension" / "src" / "core.ts").read_text()
|
|
|
|
assert "isBrowserErrorUrl" in core
|
|
assert "isErrorPageScriptError" in core
|
|
assert "chrome-error://" in core
|
|
assert "edge-error://" in core
|
|
assert "brave-error://" in core
|
|
assert "about:neterror" in core
|
|
assert "about:certerror" in core
|
|
assert "isTransientScriptError(e)" in core
|
|
|
|
def test_read_only_dom_commands_have_error_page_fallbacks():
|
|
dom = (ROOT / "extension" / "src" / "commands" / "dom.ts").read_text()
|
|
|
|
assert "fallbackForErrorPageDomOp" in dom
|
|
assert 'case "domExists":' in dom
|
|
assert "return false;" in dom
|
|
assert 'case "domQuery":' in dom
|
|
assert 'case "extractText":' in dom
|
|
assert "isBrowserErrorUrl(tabUrl)" in dom
|
|
assert "isErrorPageScriptError(e)" in dom
|
|
|
|
def test_navigation_and_tabs_report_browser_error_pages():
|
|
tabs = (ROOT / "extension" / "src" / "commands" / "tabs.ts").read_text()
|
|
navigation = (ROOT / "extension" / "src" / "commands" / "navigation.ts").read_text()
|
|
|
|
assert "lastUrl" in tabs
|
|
assert "lastStatus" in tabs
|
|
assert "showing an error page" in tabs
|
|
assert "last URL:" in tabs
|
|
assert "isBrowserErrorUrl" in navigation
|
|
assert "showing an error page while waiting for load" in navigation
|