Skip to content

Allow Browser plugin file URLs on Linux#305

Closed
VrtxOmega wants to merge 1 commit into
ilysenko:mainfrom
VrtxOmega:fix/browser-file-url-policy
Closed

Allow Browser plugin file URLs on Linux#305
VrtxOmega wants to merge 1 commit into
ilysenko:mainfrom
VrtxOmega:fix/browser-file-url-policy

Conversation

@VrtxOmega
Copy link
Copy Markdown
Contributor

Summary

  • Patch the staged Browser plugin browser-client.mjs URL policy so advertised local file:// targets are allowed on Linux.
  • Keep data: URLs blocked by the upstream policy.
  • Add smoke coverage to the Browser plugin staging fixtures.

Context

Fixes #268. The Browser plugin description advertises local file:// support, but the bundled Browser client only allowed http: and https: after about:blank. This keeps the policy narrow by adding file: only for the staged Browser plugin path.

Validation

  • bash -n scripts/lib/bundled-plugins.sh tests/scripts_smoke.sh
  • git diff --check
  • targeted Browser staging smoke: test_browser_use_node_repl_fallback_runtime; test_browser_plugin_renamed_upstream_staging
  • env -i HOME="$HOME" PATH="$PATH" USER="$USER" SHELL="$SHELL" TERM="${TERM:-xterm}" bash tests/scripts_smoke.sh

@ilysenko
Copy link
Copy Markdown
Owner

Thanks for working on this. I am going to close this PR because we fixed the issue in #306 with a narrower patch and tests against the current upstream bundle shape.

The main problems with this PR were:

  • The URL-policy needle does not match the current Browser plugin browser-client.mjs; fresh upstream 26.519.41501 still uses a try { new URL(...) } catch { return false } helper shape, so this patch leaves the real staged client unchanged.
  • The smoke fixture used a simpler helper shape than the current upstream bundle, so CI could pass without proving that the real Browser client was fixed.
  • The policy allowed all file: URLs. The replacement fix keeps this narrower by allowing local file:///... and file://localhost/..., while keeping remote file://host/..., data:, javascript:, ftp:, and invalid URLs blocked.
  • The tests only checked for inserted strings, not the actual URL-policy behavior. [codex] Fix Browser plugin file URL policy #306 adds a behavior test for the helper true/false decisions.

Closing this in favor of #306. Thanks again for identifying the issue and pushing the first fix.

@ilysenko ilysenko closed this May 24, 2026
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 plugin file:// support is blocked by URL policy on Linux desktop build

2 participants