Repository navigation
fix(browser): let a local HTML page follow its own file:// links - #30611
Conversation
The guest will-navigate guard cancelled every file: navigation, so clicking a relative link on a file:// page did nothing. Allow file: -> file: when the current page is itself a local file; web pages still cannot navigate or redirect into the filesystem.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
ELI5
If you open a local HTML file in Orca's built-in browser, clicking a link to another local file (for example
<a href="index.html">) did nothing. Chrome and Safari follow it. Now Orca does too.What Changed
Before: on a
file://page in an Orca browser tab, clicking a relative or absolute link to another local file was silently cancelled. Typing afile://address still worked.After: a local page can follow its own links to other local files. A web page (
http/https) still cannot navigate or redirect the tab to a local file.Mechanism: the browser tab's
will-navigateguard cancelled everyfile:URL. That event fires when the page navigates itself (a link click), not when Orca loads an address, which is why typed URLs worked and clicks didn't. The guard now lets afile:target through when the page currently shown in the tab is itself afile:page. All other navigations go through the existing check unchanged, and redirects tofile:stay blocked.Why
The block was added with the HTML-preview feature so a remote web page could never steer the tab onto the local disk. That rule was wider than its goal: it also caught local pages linking to each other, which is the normal way multi-page local docs work.
Alternatives considered:
../other/page.html, which Chrome allows.file://. It would also fix root-relative links and module scripts, but it is a much larger change for this bug.Matching Chrome keeps the fix small. Chromium still treats each local file as its own separate origin, so a local page that opens another local file cannot read its contents.
The browser used by paired clients and the document-preview tab keep their stricter rules on purpose. A paired client must not be able to read the host's files.
Visual Proof
N/A for screenshots: the visible change is "a link click now navigates". I checked it in a hidden dev build by sending real mouse clicks over the devtools protocol and reading the tab's URL afterwards:
plan.html→ relative link toindex.htmlplan.htmlindex.htmlhttp://127.0.0.1page →file://linkTesting
browser-manager-guest-lifecycle.test.tsnow checks that afile:link is blocked from a web page and allowed from a local page. Thesrc/main/browsersuite passes andpnpm tc:nodeis clean.AI Disclosure
Review
Agent skill upstream boundary
Notes
file:.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)