Skip to content

feat(browser): Let the extension reach local files, and say when it may not - #799

Merged
leookun merged 1 commit into
mainfrom
browser-file-access
Nov 5, 2026
Merged

leookun merged 1 commit into
mainfrom
browser-file-access

Conversation

@leookun

@leookun leookun commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Two things agents could not do through the extension: open a local HTML file, and upload files. Both need Chrome's per-extension "Allow access to file URLs", which Chrome only shows to an extension that could want file access (Chromium: PermissionsParser sets wants_file_access for a file:// host pattern or for activeTab). Ours had neither, so the switch never appeared.

  • manifest: activeTab (no install warning, unlike a host permission), version 0.2.0
  • the extension's hello says fileAccess (chrome.extension.isAllowedFileSchemeAccess()); the extension reloads when the user flips it, and says hello again
  • off: browser_open/browser_navigate of a file:// URL and the upload action tell the agent what the user has to turn on; Settings → Browser shows it as a status row
  • browser_open takes a local file's path too

Tested: browser_bridge_test; live with the installed Chrome: opening a local file by its path, uploads (devtools live test), and with file access turned off (via developerPrivate) the hello's fileAccess: false, the agent's message, and Chrome's own errors without the check ("Navigating to local URL is not allowed", "Not allowed").

🤖 Generated with BaoCode

…ay not

Chrome shows an extension's "Allow access to file URLs" switch only if it
could want file access; ours could not, so the switch never showed, and
through the debugger it could neither open a file:// page ("Navigating to
local URL is not allowed") nor give a file input its files ("Not allowed").
activeTab makes it one that could, with no install warning. The extension
says in its hello whether the switch is on: off, browser_open/navigate of a
file and upload tell the agent what the user has to turn on, and Settings →
Browser says so too. browser_open takes a local file's path as well.

Co-Authored-By: BaoCode <noreply@baocode.dev>
@leookun
leookun merged commit 99957f4 into main Nov 5, 2026
3 checks passed
@leookun
leookun deleted the browser-file-access branch November 5, 2026 14:32
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.

2 participants