docs(harper.js): add Chrome extension example and docs page - #3929
Open
leepokai wants to merge 2 commits into
Open
docs(harper.js): add Chrome extension example and docs page#3929leepokai wants to merge 2 commits into
leepokai wants to merge 2 commits into
Conversation
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.
Note
Per Harper's policy on agent PRs: this PR was authored with an LLM-based agent (Claude Code), human-directed and reviewed. End-to-end verification is described below.
Closes #3628
What
packages/harper.js/examples/chrome-extension/: a minimal Manifest V3 extension whose popup lints a textarea withharper.jsand shows the bundled version — the "tiny example… opens a popup… and displays the harper-core version" asked for in Docs: Add an intro for how to useharper.jsinside a Chrome extension #3628./docs/harperjs/chrome-extensioncovering the three MV3 pitfalls that make this "next level complicated":build.jscopies theharper.jsdist into the extension, andbinaryInlinedavoids a separate fetch for the wasm binary.wasm-unsafe-eval.WorkerLinterspawns its Web Worker from a blob URL, which the extension CSP blocks — so the example usesLocalLinter.packages/web/vite.config.ts.Verification
harper.js@2.7.0and loaded the resultingdist/as a real unpacked extension in Chromium (Playwright,--load-extension):harper.js 2.7.0biome checkclean on the new files.The version question raised in the issue is addressed at the bottom of the docs page: there is no runtime API exposing the engine version, but
harper.jsandharper-coreare versioned together (both currently 2.7.0), so the package version identifies the engine.