Repository navigation
feat(browser): ask before a page opens another app - #30490
Conversation
7eda5e8 to
b30146e
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
771e7137-52dc-4e5f-b244-389e8dbed1fd
📒 Files selected for processing: 21
src/main/browser/browser-external-app-launch.test.tssrc/main/browser/browser-external-app-launch.tssrc/main/browser/browser-manager-external-app-routing.test.tssrc/main/browser/browser-manager-guest-navigation-policy.tssrc/main/browser/browser-manager-guest-popup-policy.tssrc/main/browser/browser-manager-queries.tssrc/main/browser/browser-manager-state.tssrc/main/browser/browser-session-partition-policies.test.tssrc/main/browser/browser-session-partition-policies.tssrc/main/ipc/browser-preview-tool-authorization.test.tssrc/main/ipc/browser.tssrc/preload/api/browser-api.tssrc/preload/api/browser-bridge-guest-registration-and-downloads.tssrc/renderer/src/App.tsxsrc/renderer/src/components/browser-pane/browser-external-app-confirmation.test.tssrc/renderer/src/components/browser-pane/browser-external-app-confirmation.tsxsrc/renderer/src/components/confirmation-dialog-context.tssrc/renderer/src/components/confirmation-dialog.test.tsxsrc/renderer/src/components/confirmation-dialog.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/shared/browser-external-app.ts
💤 Files with no reviewable changes: 1
- src/main/browser/browser-manager-queries.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
b30146e to
c99a8a6
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
47a70561-1ece-46ef-8f95-9199bb33d2d2
📥 Commits
Reviewing files that changed from the base of the PR and between b30146e and c99a8a6cc5d68e36bd89db437384036bb65d0720.
📒 Files selected for processing: 10
src/main/browser/browser-external-app-launch.test.tssrc/main/browser/browser-external-app-launch.tssrc/main/browser/browser-guest-input-gesture.tssrc/main/browser/browser-manager-external-app-routing.test.tssrc/main/browser/browser-manager-guest-navigation-policy.tssrc/main/browser/browser-manager-guest-popup-policy.tssrc/main/browser/browser-manager-registration.tssrc/renderer/src/components/confirmation-dialog-context.tssrc/renderer/src/components/confirmation-dialog.tsxsrc/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes: 1
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Links to other apps (Okta Verify, Zoom, Slack, mailto:) were dropped silently or denied. Every route now shows an "Open <app>?" prompt and Orca opens the app only when the user says yes.
Link clicks, redirects and window.open named the top page, so a request from an embedded frame read as coming from the site the user trusts. They now use the initiating frame or the opener's referrer, and name no site when Electron cannot say.
A page looping a deep link reopened the app-modal prompt after every Cancel, locking the user out of Orca. A refused page now stays quiet until the user clicks or types in it, as in Chrome. Closing a page also closes its prompt, so Open cannot launch an app for a page that is gone.
shell:, vbscript:, hcp:, ms-help:, afp: and the rest of Chrome's denied list now never reach the open-app prompt, as in Chrome.
c99a8a6 to
7ed9116
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
df269fd4-f79b-4fc0-91d5-29ae322a859e
📥 Commits
Reviewing files that changed from the base of the PR and between c99a8a6cc5d68e36bd89db437384036bb65d0720 and 7ed9116.
📒 Files selected for processing: 3
src/main/browser/browser-external-app-launch.test.tssrc/main/browser/browser-external-app-launch.tssrc/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes: 1
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Choosing Open on a link no installed app handles did nothing. The answer now returns the launch result, and the window shows a toast when the OS could not start an app.
ELI5
Some sign-ins finish in an app on your computer: Okta Verify, Slack, Zoom, Teams, your mail app. When a site in Orca's browser tried to open one of those apps, Orca quietly said no, so the click did nothing and the sign-in got stuck. Now Orca asks "Open Slack?" the way Chrome does, and opens the app if you say yes.
What Changed
Before: a link to another app did nothing. A link click or redirect was cancelled with no message. An iframe launch (the route Okta FastPass takes) showed "asked for permission to open a link outside Orca, and Orca denied it". A
window.openshowed "tried to open a popup Orca does not support".After: every one of those routes shows a prompt that names the app and the asking site, for example "Open Slack?" / "https://acme.okta.com wants to open another application." Open launches the app. Cancel leaves the page where it was. When the system can't name the app (always on Linux, where Electron returns a
.desktopid), the title falls back to the link type, e.g. "Open this zoommtg link?". Cancel has focus, so Enter or Escape never launches anything by accident.How:
browser-external-app-launch.ts. The three places that used to block now hand the link to it: the navigation guard (link clicks and redirects), Electron'sopenExternalpermission request (iframes), and the popup handler (window.open).http,https,file,javascript,data,blob,about, …), Chrome's own denied list (shell,vbscript,hcp,ms-help,afp, …), and pages with no window on this machine. A page streamed from a remote server must not be able to launch apps on that server.shell.openExternalonly on a yes. The window answers with a one-time request ID, so it can only launch a link a page actually asked for.window.open, and the requesting frame for iframes. So an embedded frame from another site can't borrow the name of the page around it. When Electron can't say who asked (a page that withholds its referrer, say), the prompt reads "A page in the browser wants to open another application."AbortSignal, so a caller can dismiss its own prompt. Nothing changes for the other callers unless they pass one.Why
This copies T3 Code's approach: a fixed list of schemes that never open an app, and a question for everything else. T3 Code shows a native message box. Orca uses its own dialog so the prompt matches the app and stays inside the window that owns the tab.
One deliberate difference: T3 Code lets the navigation go ahead and answers Electron's permission request, after which Electron launches the app. Orca blocks the navigation and launches the app itself after the user says yes. Letting the navigation run would push a URL that never loads through the tab's navigation bookkeeping, and the address bar would flash
zoommtg://…. It would also leave two different launch paths. With one owner and one launch path, the link-click, iframe and popup routes behave the same.No "always allow" checkbox in this PR. Remembering a choice needs storage and a way to undo it in settings, so it can follow if people find the repeated question annoying.
Where this fits in the browser sign-in work: this is the first piece of the plan to let people sign in to any site in Orca's browser. It closes the "hand off to a desktop app" category: Okta Verify, plus every "Sign in with your browser, then open the app" flow (Slack, Zoom, Teams, Figma, Linear, editors). It also sets the rule that anything leaving the browser for another app goes through one place and asks first, so later work that hands off to native apps (a password-manager helper, a passkey helper) has a home. It does not cover the other sign-in gaps: Okta's local-network check, basic-auth login boxes, Google's browser checks, passkeys and password-manager extensions. Those are separate PRs.
Linked Issue
Fixes #12719
Visual Proof
Same page, same click on a link to Slack.
Before: the link click does nothing, and the iframe launch gets the denial notice. After: the prompt names the app.
Video covering five routes (a mail link, an app link, a hidden iframe,
window.open, a server redirect), each one prompting and cancelling while the page stays put:open-app-prompt-demo.webm
Testing
Manual, macOS, hidden dev build:
mailto:link, an unhandled scheme, a hidden iframe,window.open, a script redirect and a server 302 each showed the prompt. The page and address bar stayed put.127.0.0.1:48617embedding a frame fromlocalhost:48618, the page's own link named127.0.0.1:48617, while atarget=_toplink and awindow.openinside the frame both namedlocalhost:48618.Automated:
browser-external-app-launch.test.tscovers asking and launching only on yes, the refused schemes, one prompt per tab, answers from the wrong window, and expiry closing the prompt.window.openand the permission request.AbortSignal.trusted.exampleis named asuntrusted.example, and that a request with no known source names no site.Not tested: Windows, Linux, and a real Okta tenant.
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
shell.openExternalandapp.getApplicationNameForProtocolexist on all three systems. Linux uses the link-type title on purpose.window.opento an app link stays blocked there. Their link clicks and redirects go through the same guard.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)