Repository navigation
feat(capture): reload the extension from the CLI - #47
Merged
Merged
Conversation
`--reload` asks the service worker to call chrome.runtime.reload() and waits until the fresh worker's native host answers a ping, so a rebuilt dist/ loads without restarting the browser. An older build answers unknown_action and the CLI says it needs one manual reload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds
node scripts/sourcecapsule-capture.mjs --reload, which loads a rebuiltdist/without a browser restart.reloadaction. It replies first, then callschrome.runtime.reload(). The new worker reconnects to a new host when it starts, and the 30s alarm is the backstop.pingfor up to 45s and prints the pong withreloaded: true.unknown_action. The CLI then exits 1 and says that build needs one reload from brave://extensions.Tests:
test/native-host.test.mjscovers both the reload path and the old-build path against a fake pipe server.npm test, lint and format check pass.🤖 Generated with Claude Code