Skip to content

fix(browser): honest blocked-page copy for target-site 4xx/5xx (#39) - #42

Merged
Xuepoo merged 2 commits into
mainfrom
carryctx/web-0040-browser-compat
Aug 25, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
carryctx/web-0040-browser-compat

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

PR body

Closes #39 (proxy half already merged: vectojs/webos-proxy#1).

Honest blocked-page handling for the WebOS browser:

  • New src/model/proxy-errors.ts: the proxy's relayed upstream status (not the Worker's 200) classifies the outcome — 403/412 → "site blocked the request" copy with an open-externally hint, 429 → rate-limited wait-and-retry, other 4xx/5xx → site-error. Anti-bot challenge pages can no longer render as content.
  • Timeout/abort and stale-response guards from UI/UX audit round 2: remediation batch #25/fix(webos): UI/UX audit round-2 remediation batch (#25) #26 unchanged.
  • Render test pins the 412 branch (mutation-checked: reverting the guard fails CI).
  • Accepted limitation documented: a site returning HTTP 200 with a challenge body still renders as content (undetectable without unreliable sniffing).

Live verification (production proxy): wikipedia/github/HN 200 real content; bilibili 412 → honest blocked copy (CF egress IP class is hard-blocked by bilibili risk control regardless of headers).

Gates: 196 pass / 0 fail · tsc · oxlint · oxfmt repo-wide · vite build.

Xuepoo added 2 commits August 25, 2026 19:11
The proxy now relays the upstream HTTP status. On 403/412-style answers
the stripped body is the site's own anti-bot challenge page, which until
now rendered as if it were site content (bilibili 412 风控 report).

classifySiteStatus/sitFailureCopy in src/model/proxy-errors.ts classify
the relayed status — 403/412 → site-blocked, 429 → rate limited, other
4xx/5xx → site-error — and browser.ts renders honest human copy with a
suggestion to open the address externally. Timeout/abort behavior from
#25/#26 is unchanged.
…39)

Mocks the proxy contract exactly as the Worker ships it - HTTP 200
envelope carrying the target site's {status: 412} - so reordering the
render if/else chain in browser.ts back to the success-first shape
renders the anti-bot challenge body and fails CI. Asserts blocked
title/copy/status band and that no challenge marker survives in any
rendered text.
@Xuepoo
Xuepoo force-pushed the carryctx/web-0040-browser-compat branch from d76af11 to 41242c6 Compare August 25, 2026 11:11
@Xuepoo
Xuepoo merged commit 7ef3344 into main Aug 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser: real-site compatibility — browser-grade proxy headers + honest blocked-page copy

1 participant