Repository navigation
Browser extension MVP: "Download PDF" on GitHub markdown views (MAK-200) - #1
Merged
lecstor merged 5 commits intoOct 13, 2026
Merged
Conversation
…smoke Native fetch throws Illegal invocation when invoked as a property of an object (background deps, adapter instance) — found by the real-browser smoke. boundFetch() is now the single place fetch is bound. Chromium smoke (scripted, against production): button injected on a blob view, real anonymous render downloaded as fixture.pdf, soft navigation to second.md leaves exactly one working button, repo-home README button present. Firefox half remains manual.
… Firefox Xray base64; scripted Firefox smoke
Adversarial review findings, each with a regression test:
- Repo-home READMEs: the raw route is a case-sensitive path lookup, so
README.md/readme.md/Readme.md/…markdown are all tried.
- The 20-image pre-flight now counts every img src (relative, absolute,
data:), because the server's cap counts the whole document and skips the
extras without a trace.
- The home button always floats; a rendered README's own /raw/ link is page
content, not the header's Raw button, and must not become an insertion
point.
- base64FromBytes no longer spreads a typed array: in Firefox content
scripts that spread trips the Xray compartment check ('Permission denied
to access property "constructor"'), which broke every image inlining.
Found by the Firefox smoke.
- smoke/firefox-smoke.mjs drives the real Firefox over Marionette (web-ext
temporary install) and runs the same flow as the Chromium smoke; it
caught the Xray bug end to end.
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.
Closes MAK-200. The repo's only line is
main(nostaging/integrationbranch exists), so this PR targetsmain.What
MV3 + TypeScript extension, one build producing
dist/chromiumanddist/firefox(plus zips). On a GitHub.md/.markdownfile view — and on a repo home's rendered README — a Download PDF button renders the file throughPOST https://makespdf.com/api/v1/mdand downloads<file-stem>.pdf..../raw/<ref>/<path>, works for private repos and refs containing/); the rendered page is never scraped.,<img src>) are fetched with the session and inlined asdata:URIs; a failed image stops the export and names it (MAK-191 precedent). 5 MB/image, 20 images/document, absolute URLs left to the server.Authorization: Bearer <key>only when a key is saved in the options page (storage.local, never synced).X-MakesPDF-Client: browser-extension/<version>+<build>baked per package (+chromium/+firefox), pinned by unit tests against the built bundles.storage, content script ongithub.com, host permission formakespdf.com. No<all_urls>, nodownloads.Review fixes — commit 98f49f7 (the scoped follow-up pass)
The adversarial review gate's findings, all with regression tests:
README.mdalone 404s for lowercase/Readme.mdrepos (verified againstsindresorhus/awesome); the home fetch now tries the six common spellings.imgsrc and skips the extras silently; the pre-flight now counts all of them./owner/repo/raw/...link looked like the header's Raw button and planted the button inside the README; the home button always floats.base64FromBytesspread a typed array intoString.fromCharCode(...), which in Firefox content scripts throwsPermission denied to access property "constructor"and broke every image inlining. Fixed by reading code units into a plain array.Manual smoke record (doneWhen 7)
Both packages were built from 98f49f7 and driven end to end:
Chromium —
node smoke/chromium-smoke.mjs(Playwright, headless,SMOKE_REF= this branch), scripted against production:smoke/fixture.md: button injected; click → real anonymous render → fixture.pdf, 45,576 bytes,%PDF-smoke/second.md: exactly one button, still bound to the new file → second.pdf, 42,147 bytesmakesPDF/makespdf-vscode-plugin): floating button presentFirefox —
node smoke/firefox-smoke.mjs(real Firefox,web-exttemporary install, Marionette-driven; new in this PR):Still manual (not automatable here — needs a signed-in browser session): a private-repo file with relative images. The public fixture exercises the same raw-route + session-cookie path.
Verification
npm run typecheck— cleannpm test— 94 tests / 10 files, all pass (URL matching incl. slash refs, path resolution, image limits and failure messages, HTTP error mapping, header literal per built package, controller/soft-nav idempotence)npm run build+npm run verify:packages— both packages build; structural checks passweb-ext lint(Firefox package) — 0 errors; 1 warningMISSING_DATA_COLLECTION_PERMISSIONS— the AMO data-consent key is deliberately deferred: it is only required for store submission (this MVP ships no store assets/icons), and declaring it forcesstrict_min_versionfrom 115 to Firefox 140 (addons-linter enforces the pairing), which would silently drop 115–139 for no current benefit. Recorded as a decision on the task; a one-line change when the store-submission task happens.Notes for the reviewer
typecheck→test→build→verify:packages).--headlessMarionette driver is documented insmoke/firefox-smoke.mjs.