Repository navigation
Isolated plugin frames, off by default - #36813
Merged
Merged
Conversation
This was referenced Oct 31, 2026
nwparker
force-pushed
the
nwparker/plugin-isolated-frames
branch
from
November 1, 2026 00:21
65dd1f4 to
7adefde
Compare
8 of 9 tasks
nwparker
force-pushed
the
nwparker/plugin-isolated-frames
branch
from
November 1, 2026 07:32
68f260f to
ec98578
Compare
nwparker
changed the base branch from
nwparker/plugin-frame-permission-policy
to
main
November 1, 2026 07:32
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Today a plugin's panel or custom editor runs as a page inside Orca's own window. It shares Orca's browser session, and the only thing stopping it from reaching the internet is a content-security header. This PR adds a second way to run plugin pages: each plugin gets its own sealed-off browser view, with its own process and storage, where network access is blocked by the session itself. Plugins also get real files (scripts, workers, WebAssembly, images) instead of one giant inlined HTML page.
It ships switched off. With the switch off, nothing changes for anyone. A later one-line PR turns it on.
What Changed
With the switch off (the default after this PR): plugin frames stay the
srcdociframe they are today. The new APIs below are not offered (orca.shellandorca.filesare undefined, andorca.host.has()returns false for them).With the switch on (
ORCA_PLUGIN_ISOLATED_FRAMES=1, or theexperimentalPluginIsolatedFramessetting), on the desktop app:<webview>on partitionpersist:orca-plugin-<key>, where<key>is a hash of the plugin id. That gives each plugin its own renderer process, cookies,localStorageand IndexedDB.orca-plugin-frame://<key>/…. It serves files from the plugin folder only, with the same path containment and content-integrity checks Orca already uses for entries.Rangerequests.webRequestallowlist (only the plugin's own origin,data:,blob:);alert/confirmdialogs disabled.window.orcascript the iframe gets; only the transport differs (ipcRenderer.sendToHostfrom a sandboxed preload). Message validation, budgets, sessions and capability checks are unchanged.orca.shell.openExternal(url)openshttp,httpsandmailtolinks only, and resolves{ opened }. Before opening a web host this plugin hasn't been allowed, Orca asks: " wants to open ", with Open / Cancel and "Always allow this host".orca.files.saveAs({ suggestedName, mimeType, data })shows Orca's save dialog and resolves{ status: 'saved' | 'cancelled' }. The plugin never sees the path. Dangerous file types (executables, scripts, shortcuts, disk images) are refused, and saved files get the OS "downloaded" mark (Mark of the Web on Windows, quarantine on macOS).orca.localeexposes Orca's UI language.<webview>keep the iframe: the browser and serve clients, plus mobile, which has no panels.Why
RTCPeerConnectionor DNS prefetch can still get out.<webview>per plugin rather than a sandboxed iframe on a custom origin: only a separate session gives a separate network stack (proxy,webRequest), separate storage and a separate process. An iframe shares the main window's session.<link rel="dns-prefetch">hostnames outside both the proxy andwebRequest, so each guest also runs with DNS prefetching disabled. The egress test asserts no resolver lookups. The only way data leaves is a URL the person agrees to open.Linked Issue
N/A (maintainer change).
Visual Proof
Nothing changes by default (switch off). With the switch on, panels and editors look the same as today. The screenshots below are with
ORCA_PLUGIN_ISOLATED_FRAMES=1: Excalidraw 2.0 running as a multi-file app in an isolated view, with export through Orca's save dialog.(screenshot removed: contained real product data)
Testing
Unit:
__orcareservation, trailing dot/space refusal, Range, streaming, the in-flight cap and per-file digests;will-attach-webview) and the guest preload transport and send caps;saveAsextensions, rate limits, per-window parent), the switch, and shortcut forwarding for guests.Electron:
plugin-frame-guest-egress.electron.test.tscounts TCP connections to a local listener fromfetch, WebSocket,sendBeacon, a Worker, a SharedWorker and WebRTC TURN, and asserts 0. It also pins the DNS-prefetch residual.e2e:
ORCA_PLUGIN_ISOLATED_FRAMES=1(demo, custom editor, new file, try-it, containment, isolated frame);srcdociframe with no gesture APIs;Quality gates:
pnpm tcandcheck:code-quality:changedpass.Platforms: macOS only. Linux/Windows run in CI. The containment spec stays
experimentaluntil CI has soaked it on every desktop platform.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Stack (merge in order):
Reviewed adversarially before opening: security, regressions, and an independent second model. Fixed as a result:
saveAstypes, and no clipboard writes (same as the iframe today).__orcaalias on Windows, and per-window dialog parenting.Second, holistic review before merge (whole plugin system, plus a reference comparison and an independent model). Fixed in this PR:
node_modules.execCommand('copy')works only inside a click.secrets.protection().The design contract is
docs/reference/plugin-isolated-frames.md.Agent skill upstream boundary
Notes
openExternalasks before opening a new host.PluginFrameEntryfields are optional;not_permitted;helloreports API minor 0 to iframe clients, so feature detection is honest.srcdocread, hash and IPC transfer, so each open runs one integrity check, not two;Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)