Skip to content

feat(browser): ask before a page opens another app - #30490

Merged
AmoabaKelvin merged 5 commits into
mainfrom
ask-before-opening-another-app
Oct 19, 2026
Merged

AmoabaKelvin merged 5 commits into
mainfrom
ask-before-opening-another-app

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​631 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​628
Prod 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​489 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​473

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.open showed "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 .desktop id), 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:

  • One owner in the main process, 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's openExternal permission request (iframes), and the popup handler (window.open).
  • What it refuses without asking: web and browser-internal schemes (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.
  • What it asks: it sends the prompt to the window showing the tab and launches with shell.openExternal only on a yes. The window answers with a one-time request ID, so it can only launch a link a page actually asked for.
  • Which site it names: the frame that asked, never just the top page. That's the frame that started the navigation for link clicks and redirects, the opener's referrer 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."
  • Limits:
    • One prompt per tab at a time, so a page looping a deep link can't stack dialogs.
    • As in Chrome, once you cancel a prompt or let it expire, that page can't ask again until you click or type in it. Without this, a page retrying a deep link would reopen the app-wide prompt after every Cancel and lock you out of Orca. Saying yes never silences a page.
    • A request expires after two minutes, and closing the tab closes its prompt too, so no Open button is left that would launch an app for a page that's gone.
  • When the launch fails: if you click Open but no app on the computer handles the link (Zoom or Okta Verify not installed), a toast says so instead of nothing happening.
  • The prompt reuses the shared confirmation dialog (the one behind the doc-preview "Open link to…?" prompt). It gains an optional 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 (main) After (this PR)
open-app-before.png open-app-after.png

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

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Manual, macOS, hidden dev build:

  • A real mouse click on a 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.
  • With real apps installed, Open launched Slack, Spotify, Maps, Dictionary, Shortcuts, System Settings and the App Store from their links.
  • An unanswered prompt closed itself after two minutes.
  • A page retrying a Zoom link every 300ms showed one prompt. After Cancel, nothing more appeared until I clicked the page; then it asked once and went quiet again after a second Cancel.
  • Clicking Open on a link no installed app handles showed "Couldn't open an app for this orcatest-nohandler link. It may not be installed." macOS really does fail the launch, and no system dialog appeared.
  • On a page at 127.0.0.1:48617 embedding a frame from localhost:48618, the page's own link named 127.0.0.1:48617, while a target=_top link and a window.open inside the frame both named localhost:48618.

Automated:

  • browser-external-app-launch.test.ts covers asking and launching only on yes, the refused schemes, one prompt per tab, answers from the wrong window, and expiry closing the prompt.
  • Wiring tests cover each entry point: link click, window.open and the permission request.
  • The renderer tests cover the prompt copy, the answer sent back, and dismissal on close. A dialog test covers dismissal by AbortSignal.
  • The entry-point wiring test checks that an embedded frame on trusted.example is named as untrusted.example, and that a request with no known source names no site.
  • Tests also cover the page staying quiet after Cancel or expiry until a click or keypress (a mouse move doesn't count), closing a page closing its prompt, Chrome's denied schemes never prompting, and a failed launch reaching the window as a toast.
  • Each of those tests fails with its fix removed.

Not tested: Windows, Linux, and a real Okta tenant.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • Security: nothing launches without a click on Open. Web and internal schemes are never handed to the OS. Only the window that received a prompt can answer it, and only once.
  • Cross-platform: shell.openExternal and app.getApplicationNameForProtocol exist on all three systems. Linux uses the link-type title on purpose.
  • SSH and remote: pages in SSH workspaces run on this machine, so the app opens on the user's own computer. Pages streamed from a remote server are refused rather than launching apps on the server. Client-hosted pages loaded through a remote server's network keep their own popup handler, so window.open to an app link stays blocked there. Their link clicks and redirects go through the same guard.
  • Wire compatibility: the new messages run only between this machine's main process and its own window. Nothing changes in what a paired client and host exchange.
  • Mobile: not affected.
  • Performance: no work happens unless a page tries to open an app.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@AmoabaKelvin
AmoabaKelvin force-pushed the ask-before-opening-another-app branch from 7eda5e8 to b30146e Compare October 19, 2026 03:21
@AmoabaKelvin
AmoabaKelvin marked this pull request as ready for review October 19, 2026 11:37
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 88f11192-c522-4e58-9bde-3869ae343021
📥 Commits

Reviewing files that changed from the base of the PR and between 7ed9116 and dbffef5.

📒 Files selected for processing: 9
  • src/main/browser/browser-external-app-launch.test.ts
  • src/main/browser/browser-external-app-launch.ts
  • src/main/ipc/browser.ts
  • src/preload/api/browser-api.ts
  • src/preload/api/browser-bridge-guest-registration-and-downloads.ts
  • src/renderer/src/components/browser-pane/browser-external-app-confirmation.test.ts
  • src/renderer/src/components/browser-pane/browser-external-app-confirmation.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/shared/browser-external-app.ts
🚧 Files skipped from review as they are similar to previous changes: 6
  • src/preload/api/browser-api.ts
  • src/renderer/src/components/browser-pane/browser-external-app-confirmation.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/preload/api/browser-bridge-guest-registration-and-downloads.ts
  • src/renderer/src/components/browser-pane/browser-external-app-confirmation.test.ts
  • src/main/browser/browser-external-app-launch.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The change adds external-app URL validation and a request-and-response flow for browser launch attempts. Browser navigation, popup, and permission policies route eligible attempts to that flow. The renderer displays a confirmation prompt with app, scheme, and origin details when available. Responses travel through browser IPC and preload APIs. Pending requests are limited per page and expire after 120 seconds. Confirmation dialogs now support abort signals.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to dbffe

The identified prompt, tab-closure, and protocol risks are addressed. The external-app handoff is ready to merge after normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning The PR implements an approval prompt, OS launch through shell.openExternal, scheme filtering, origin naming, popup/top-level routing, request ownership, expiry, and launch-failure toast for [#12719]… Require and consume a recent trusted gesture on every external-app request path. Add visible actionable errors for denial, missing handlers, malformed URLs, and forbidden schemes. Implement grants scoped to browser profile, origin, and sche…
Docstring Coverage Warning Docstring coverage is 28.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 21 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: prompting users before a browser page opens an external application.
Description check Passed The description is complete and relevant. It includes the required explanation, changes, rationale, linked issue, visual proof, testing details, review notes, compatibility considerations, and checkli…
Out of Scope Changes check Passed The production changes and tests remain connected to [#12719]. Navigation, popup, iframe permission, IPC, preload, renderer prompt, gesture tracking, expiry, and shared-dialog changes support the exte…
Full details: Description check

Explanation

The description is complete and relevant. It includes the required explanation, changes, rationale, linked issue, visual proof, testing details, review notes, compatibility considerations, and checklist. It also documents untested platforms and excluded scope.

Full details: Out of Scope Changes check

Explanation

The production changes and tests remain connected to [#12719]. Navigation, popup, iframe permission, IPC, preload, renderer prompt, gesture tracking, expiry, and shared-dialog changes support the external-app handoff. No unrelated product change is demonstrated.

Full details: Linked Issues check

Explanation

The PR implements an approval prompt, OS launch through shell.openExternal, scheme filtering, origin naming, popup/top-level routing, request ownership, expiry, and launch-failure toast for [#12719]. The linked issue still has unmet coding requirements. trackBrowserGuestInputGesture exposes consume(), but the external-app request paths do not consume a trusted gesture, so navigation, iframe, and popup requests can prompt without one. Malformed and forbidden URLs return false without a visible actionable error. The PR adds no remembered grants or revocation settings, no sanitized outcome telemetry or audit logging, and no agent-visible external-app-requested or awaiting-user-approval state.

Resolution

Require and consume a recent trusted gesture on every external-app request path. Add visible actionable errors for denial, missing handlers, malformed URLs, and forbidden schemes. Implement grants scoped to browser profile, origin, and scheme, with inspection and revocation. Add requested, approved, denied, opened, failed, and no-handler telemetry or audit events without query or fragment data. Expose the required agent request and approval state.

Full details: Docstring Coverage

Explanation

Docstring coverage is 28.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 21 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 771e7137-52dc-4e5f-b244-389e8dbed1fd
📥 Commits

Reviewing files that changed from the base of the PR and between 61b30a4 and b30146e.

📒 Files selected for processing: 21
  • src/main/browser/browser-external-app-launch.test.ts
  • src/main/browser/browser-external-app-launch.ts
  • src/main/browser/browser-manager-external-app-routing.test.ts
  • src/main/browser/browser-manager-guest-navigation-policy.ts
  • src/main/browser/browser-manager-guest-popup-policy.ts
  • src/main/browser/browser-manager-queries.ts
  • src/main/browser/browser-manager-state.ts
  • src/main/browser/browser-session-partition-policies.test.ts
  • src/main/browser/browser-session-partition-policies.ts
  • src/main/ipc/browser-preview-tool-authorization.test.ts
  • src/main/ipc/browser.ts
  • src/preload/api/browser-api.ts
  • src/preload/api/browser-bridge-guest-registration-and-downloads.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/browser-pane/browser-external-app-confirmation.test.ts
  • src/renderer/src/components/browser-pane/browser-external-app-confirmation.tsx
  • src/renderer/src/components/confirmation-dialog-context.ts
  • src/renderer/src/components/confirmation-dialog.test.tsx
  • src/renderer/src/components/confirmation-dialog.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/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.

@AmoabaKelvin
AmoabaKelvin force-pushed the ask-before-opening-another-app branch from b30146e to c99a8a6 Compare October 19, 2026 12:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts
  • src/main/browser/browser-external-app-launch.ts
  • src/main/browser/browser-guest-input-gesture.ts
  • src/main/browser/browser-manager-external-app-routing.test.ts
  • src/main/browser/browser-manager-guest-navigation-policy.ts
  • src/main/browser/browser-manager-guest-popup-policy.ts
  • src/main/browser/browser-manager-registration.ts
  • src/renderer/src/components/confirmation-dialog-context.ts
  • src/renderer/src/components/confirmation-dialog.tsx
  • src/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.
@AmoabaKelvin
AmoabaKelvin force-pushed the ask-before-opening-another-app branch from c99a8a6 to 7ed9116 Compare October 19, 2026 13:25

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts
  • src/main/browser/browser-external-app-launch.ts
  • src/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.
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.

[Feature]: Support user-approved external app protocol handoff from the embedded browser

1 participant