Repository navigation
fix(extension): reach the Ketch app from hand-installed copies, and upload releases to the Chrome Web Store - #536
Merged
Conversation
The dialog showed a bare "Not reachable" for a device it couldn't reach, and only the error message when a send failed. It now shows the reason and what to do, as the popup does, under the devices and with a failed send. A browser refusing the Ketch app's native messaging host for this extension ID, as for an unpacked build without the manifest key, gets its own error instead of "Couldn't reach the Ketch app".
The release's Chrome zip is the Web Store upload, without the manifest key, so a copy installed by hand with Load unpacked got an id from its folder that the Ketch app's native messaging host refuses, and could never reach the app. Releases now also carry `chrome-unpacked`, the same package with the key, which gets the id the app accepts. The release notes and README say which one to load, and the refused-copy hint points to it.
…unpacked The store upload was just "chrome", beside chrome-unpacked for Load unpacked; naming it chrome-store says which one goes to the Chrome Web Store.
…re id chrome-unpacked carried the development key, so a copy installed by hand was a second extension beside the store one. It now carries the store item's public key, read from the CRX the store serves, so Chrome and the Ketch app see it as the store extension itself (flnjeochbgpaipiofdjmoijaeooemhka). src/ keeps the development key, so a development copy can still run next to the store one.
…lease The Extension Release workflow now uploads the chrome-store package with the Chrome Web Store API v2 and submits it for review (store-upload.mjs, with an OAuth refresh token from the CWS_* secrets), before creating the GitHub release, so a refused upload releases nothing. Without the secrets it warns and keeps the package as a run artifact for a manual upload. The GitHub release now only carries the packages people install by hand: chrome-unpacked, firefox and safari.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
What
Hand-installed Chrome copies can reach the Ketch app
The GitHub release's Chrome zip was the Chrome Web Store upload, which has no manifest
key. Installed by hand with Load unpacked (for example while the store reviews a new version), Chrome gives it an ID derived from its folder. The Ketch app's native messaging host only allows the store ID and the development ID, so Chrome refused the connection, and the extension could never reach the app, however Ketch was running.chrome-store(the store upload, nokey) andchrome-unpacked(for Load unpacked).chrome-unpackedcarries the store item's public key (STORE_KEYinbuild.mjs, read from the CRX the store serves), so a hand-installed copy gets the store's ID,flnjeochbgpaipiofdjmoijaeooemhka. Chrome and the app treat it as the store extension itself.src/keeps the development key, so a development copy can still run next to the store one.The download dialog says why a device can't be reached
FailureKind.APP_NOT_ALLOWED), pointing to the store and thechrome-unpackedpackage, instead of the generic "Couldn't reach the Ketch app".Releases upload to the Chrome Web Store
chrome-store.zipwith the Chrome Web Store API v2 and submits it for review (store-upload.mjs, no dependencies). It waits while the store processes the upload, and only submits an upload the store accepted with the version the run built.CWS_*secrets the step is skipped with a warning. The store package is always kept as the run'schrome-storeartifact for a manual upload.chrome-unpacked,firefoxandsafari.Setup needed
Add these repository secrets; the README's Chrome Web Store upload section walks through them:
CWS_PUBLISHER_IDCWS_CLIENT_IDCWS_CLIENT_SECRETCWS_REFRESH_TOKEN(OAuth 2.0 Playground, scopechromewebstore)Until they are set, releases behave as before, except that the store zip is a run artifact rather than a release asset.
Notes for reviewers
media.uploadendpoint, as the API guide's example does.chrome-unpackedand a store install share an ID, so the README tells people to remove the store version before loading it, and to reinstall from the store afterwards to get updates.Testing
npm testinapp/browser-extension: 176 pass. New tests cover the store ID ofchrome-unpacked, the refused-ID error, and the upload flow (in-progress polling, refused upload, version mismatch, API and token errors, no credentials in errors).node build.mjsbuilds the four packages. I checked that thechrome-unpackedmanifest's key hashes toflnjeochbgpaipiofdjmoijaeooemhka.