Skip to content

Install-helper: check TronBrowser store before Chrome Web Store#39

Merged
ralyodio merged 1 commit into
mainfrom
worktree-tronstore-install-first
Jul 7, 2026
Merged

Install-helper: check TronBrowser store before Chrome Web Store#39
ralyodio merged 1 commit into
mainfrom
worktree-tronstore-install-first

Conversation

@ralyodio

@ralyodio ralyodio commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Problem

The Add to TronBrowser button that install-helper.js injects on Chrome Web Store detail pages navigated straight to Google's CRX (clients2.google.com/service/update2/crx). It never looked at the TronBrowser store. Since we don't publish on the Chrome Web Store, the install order was backwards.

Fix

The button now checks the TronBrowser store first, and only falls back to the Chrome Web Store CRX when the extension isn't listed there:

  • background.js — new resolve-tron-store message handler. Given the page's slug/name, it queries tronbrowser.dev/api/store (exact slug, then an exact name-search match) and returns a Tron-store download URL when a live listing with a downloadable artifact exists. Resolving in the service worker matters: it holds host permissions for tronbrowser.dev, so the fetch isn't blocked by the store page's CSP/CORS.
  • install-helper.js — extracts the slug (not just the id) from the detail URL and the name from the tab title, asks the background worker to resolve, relabels the button to "Add from TronBrowser Store" when found, and on click prefers the Tron download with the Google CRX as fallback. All failure paths (SW asleep, offline, not listed, 5s timeout) degrade to the Chrome CRX, so the button never hangs or breaks.

Verification

  • node --check passes on both files.
  • Confirmed against the live tronbrowser.dev/api/store API that the response shape gated on (status: "live", version.crxUrl/version.bundleUrl) matches production, including the slug-miss case that exercises the name-search fallback.

🤖 Generated with Claude Code

The "Add to TronBrowser" button injected on Chrome Web Store detail
pages jumped straight to Google's CRX. Since we don't publish on the
Chrome Web Store, it now resolves the TronBrowser store first (by the
page's slug, then an exact name-search match) via the background service
worker — which has host permissions for tronbrowser.dev so the lookup
isn't blocked by the store page's CSP/CORS. When a live listing with a
downloadable artifact exists, the button installs from the TronBrowser
store and relabels; otherwise it falls back to the Chrome Web Store CRX.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio ralyodio marked this pull request as ready for review July 7, 2026 02:52
@ralyodio ralyodio merged commit 398c7e7 into main Jul 7, 2026
7 checks passed
@ralyodio ralyodio deleted the worktree-tronstore-install-first branch July 7, 2026 02:53
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.

1 participant