Skip to content

feat(extensions): install from the Extension Store link on every client - #51

Merged
MadebyLeopold merged 13 commits into
mainfrom
feat/extension-store-link
Nov 17, 2026
Merged

MadebyLeopold merged 13 commits into
mainfrom
feat/extension-store-link

Conversation

@MadebyLeopold

Copy link
Copy Markdown
Member

Closes #

What changed

Tarn handles the Install in Tarn link of the Extension Store at extensions.tarnbrowser.com (Quavon-dev/tarn-extensions#1) on every client.

  • Core: engine::tarn_ext::store_install(&Url) accepts only https://extensions.tarnbrowser.com/install/<id> (no other scheme, host, port, userinfo or path; the id must pass the catalog's id rule). browser_core::extensions::install adds the store sheet: a StoreToken per sheet, STORE_CONFIRM_DELAY (700 ms) before Install works, and StoreSheet::take(token, now), so Install confirms only the sheet it was drawn for and a page can't swap the sheet under the click. At most one store link per 10 s (admit_store_link).
  • Behaviour: a main-frame navigation the user started that targets an install link is cancelled, and Settings › Extensions opens a confirmation built only from Tarn's own verified catalog copy. Nothing is requested or downloaded until the user presses Install. Unknown or revoked ids, private spaces, burner tabs and Lockdown show a short notice and install nothing. Script navigations, redirects, pop-ups and subframes never ask.
  • Clients: macOS and Windows (crates/app), Linux (WebKitGTK policy decision), iOS (navigation delegate, public API only), Android (shouldOverrideUrlLoading with hasGesture and not isRedirect). Settings › Extensions on every client gets a "Browse the store" link.
  • Docs: docs/threat-model.md S18 (web page → install prompt), docs/shared-core.md §1, the iOS gap in docs/mobile-plan.md, the Linux frame gap in docs/nsh-plan.md, PRIVACY.md (the link itself makes no request), CHANGELOG.md.
  • Merged main (feat(ui): revamp across macOS, Windows, Linux, iOS and Android #47); linux/src/ui.rs and mobile/app/src/ui/mod.rs keep both the store-link and the new icon and edit handling.

Threat model S18: the page gets no channel into the shell. It can only cause a navigation, and Tarn reads nothing from it but the id in the address. The sheet shows only the signed catalog's entry, waits for the user, and can't be swapped under the click.

Screenshots

The store this links from:

Store home
Extension page

The install link opened in another browser (no download):

Install page outside Tarn

How it was tested

  • Every check in CONTRIBUTING.md passes for the workspaces touched; checks not run, and why:
    • Ran on the merged branch: root, nsh-shared and mobile cargo fmt --check, clippy -D warnings and cargo test; mobile clippy for aarch64-apple-ios-sim; linux fmt, clippy, tests and scripts/display-tests.sh (Fedora container), including only_the_users_own_navigation_to_a_store_link_asks_to_install; mobile/android/build.sh; scripts/check-dco.sh.
    • Not run: Windows (no Windows machine here; CI runs it). The store link was not tried by hand in the iOS simulator or the Android emulator; the shared shell tests in mobile/app/tests cover it. cargo deny check was not needed: no manifest or lockfile changes.
  • Linked issue is status: approved (features and large changes) — maintainer's own work
  • No secrets, credentials or personal data in the diff
  • No change to protected paths (.github/CODEOWNERS) beyond what a maintainer asked for — touches docs/, PRIVACY.md and the engine's extension code; maintainer's own work
  • I read and understand every line and sign it off as its author
  • Any AI agent used followed "Rules for AI agents" in AGENTS.md

A main-frame navigation the user starts (a typed load or a link click with
a gesture) to https://extension.tarnbrowser.com/install/<id> is cancelled
before any request and opens the usual consent for that id, taken only
from Tarn's own verified catalog (fetched first when missing or stale).
Unknown, revoked or installed ids get a notice; private spaces, burner
tabs and Lockdown install nothing. Redirects, subframes and script
navigations without a gesture load normally. Settings > Extensions links
the store. On macOS, Windows, Linux, iOS and Android.

Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
…catalog requests

Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
…nals only on iOS

Core::admit_store_link takes at most one store link per
install::STORE_LINK_INTERVAL and every shell ignores the others without a
sheet. iOS no longer reads WebKit's private _isUserInitiated and
_isRedirect: a shell load or a main-frame linkActivated navigation asks,
so a page's own script-started link click can raise the sheet there, at
most once per 10 s, and nothing installs without the user's confirmation.

Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
…ests nothing

store_step no longer fetches: with a fresh verified catalog the link opens a
confirmation in Settings > Extensions built only from the signed entry
(store_sheet); without one a notice points to Settings > Extensions. Install
there re-checks everything (store_confirm: same entry, fresh catalog, not
revoked or installed, no install in progress, store_link_allowed for the
tab), then downloads and unpacks; a package within that entry installs
without a second prompt (store_confirmed). Refusals, including private
spaces, burner tabs and an install in progress, show a notice on the tab
on every client instead of switching screens.

Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
…ore tests

Every engine decides with nav_policy::store_link_asks. Linux marks a pop-up
tab's first load as the page's link, and mobile opens a pop-up to an install
link with its opener instead of as a routed fresh tab. The WebKit window
test proves each refused case reached the store link (blocked by a test
content rule, so nothing leaves the machine) and that the page's script ran.

Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
…mation

install::offer_store_link holds the confirmation for desktop and the shared NSH pane; only an install that is running, its consent or a package choice counts as busy. Install on the sheet still re-checks everything with store_confirm.
Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
…ay local

The display test blocks the store host with a content rule, checks that every refused navigation reached decide_navigation (recorded in the test-only event log) and that the main-frame ones were stopped by the rule.

Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
install::StoreSheet gives every store offer a token (a sequence number and
the entry's id and SHA-256). The Install button carries the token of the
sheet it was drawn for and StoreSheet::take refuses any other, and refuses
clicks within STORE_CONFIRM_DELAY (700 ms) of a sheet appearing or being
replaced; macOS and Windows also need Browser::layout_stable. Closing
Settings > Extensions (desktop pane or window, Linux panel, mobile screen)
drops an unanswered sheet. A page that raises a second sheet just before
the user taps Install can no longer get it installed.

Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
…e install on iOS

Matches S18 and docs/mobile-plan.md; the sheet token and confirm delay are described there too.

Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
Signed-off-by: Leopold <77323443+MadebyLeopold@users.noreply.github.com>
@MadebyLeopold
MadebyLeopold requested a review from a team as a code owner November 17, 2026 08:36
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a676842 and 899752d.

Files selected for processing: 41

  • CHANGELOG.md
  • PRIVACY.md
  • crates/app/src/browser.rs
  • crates/app/src/extensions.rs
  • crates/app/src/settings.rs
  • crates/browser-core/src/extensions.rs
  • crates/browser-core/src/extensions/install.rs
  • crates/browser-core/src/lib.rs
  • crates/engine/src/chromium/view.rs
  • crates/engine/src/delegates.rs
  • crates/engine/src/events.rs
  • crates/engine/src/nav_policy.rs
  • crates/engine/src/tarn_ext.rs
  • crates/engine/tests/common/mod.rs
  • crates/engine/tests/tarn_extension.rs
  • crates/shield/src/catalog.rs
  • docs/mobile-plan.md
  • docs/nsh-plan.md
  • docs/shared-core.md
  • docs/threat-model.md
  • linux/src/browser.rs
  • linux/src/browser/tests.rs
  • linux/src/snapshot.rs
  • linux/src/ui.rs
  • linux/src/ui/extensions.rs
  • linux/src/webview/display_tests.rs
  • linux/src/webview/mod.rs
  • mobile/android/host/src/main/java/dev/tarn/android/Native.java
  • mobile/android/host/src/main/java/dev/tarn/android/TarnWebView.java
  • mobile/android/rust/src/lib.rs
  • mobile/app/src/events.rs
  • mobile/app/src/extensions.rs
  • mobile/app/src/shell.rs
  • mobile/app/src/ui/extensions.rs
  • mobile/app/src/ui/mod.rs
  • mobile/app/tests/features.rs
  • mobile/app/tests/shell.rs
  • mobile/ios/src/component.rs
  • mobile/ios/src/lib.rs
  • mobile/ios/src/store_link.rs
  • nsh-shared/src/extensions.rs
  • 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

@MadebyLeopold
MadebyLeopold merged commit fcf6ebd into main Nov 17, 2026
22 of 23 checks passed
@MadebyLeopold
MadebyLeopold deleted the feat/extension-store-link branch November 17, 2026 09:15
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