Migrate to Manifest V3; modernize build (fixes #33)#34
Open
JoshuaKimsey wants to merge 4 commits into
Open
Conversation
MV3 changes (src/chrome/manifest.json):
- manifest_version 2 -> 3, version 4.0.5 -> 4.1.0
- browser_action -> action
- Add 'scripting' permission
- web_accessible_resources: string array -> object form with matches
API migration (src/chrome/popup.js):
- chrome.tabs.executeScript -> chrome.scripting.executeScript
- chrome.tabs.insertCSS -> chrome.scripting.insertCSS
- code: string -> func: arrow function
- file: -> files: array
- result[0] -> result[0].result (ready-state polling)
- null tabId -> explicit target { tabId } from tabArray[0].id
- matchAboutBlank dropped (no MV3 equivalent; Yahoo Mail popup deferred)
Build modernization:
- Replace Grunt 0.4 + grunt-preprocess with build.js (Node, zero deps)
- Single devDependency: sass (Dart Sass ^1.77.0)
- npm run build / npm run clean scripts
- Replicates @echo / @if MODE / {version} preprocessing semantics
- Chrome extension output only; bookmarklet path untouched
Verified working in Chrome MV3.
- Major version bump (4.0.5 -> 5.0.0) for the breaking MV3 platform change - README: add v5.0.0 changelog entry, building-from-source section, fork notice, and update limitations (dead Google Code link removed) - Rebuild dist/ with 5.0.0 version strings
- Keep Chris Coyier as author (original creator) - Add contributors: Devon Govett, Rob Garrison (original), Joshua Kimsey (MV3 migration) - Point homepage_url to the active fork
- build.js: add --package flag that builds then zips dist/chrome/ contents (manifest.json at zip root) into dist/printliminator-vX.Y.Z.zip using a zero-dependency zip writer - package.json: add 'npm run package' script - PRIVACY.md: Web Store-required privacy policy (extension collects no data) - PUBLISHING.md: pre-written copy for every Chrome Web Store dashboard field - .gitignore: exclude dist/*.zip build artifacts
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.
Summary
Migrates The Printliminator from Manifest V2 to V3 so it loads in modern Chrome again. The current Web Store listing installs a broken extension.
See #33 for the full context.
Changes
Manifest V3 (
src/chrome/manifest.json)manifest_version2 → 3; version 4.0.5 → 5.0.0browser_action→actionscriptingpermissionweb_accessible_resources: string array → object form withmatches: ["<all_urls>"]API migration (
src/chrome/popup.js)chrome.tabs.executeScript→chrome.scripting.executeScriptchrome.tabs.insertCSS→chrome.scripting.insertCSScode:string injection →func:arrow functionsfile:→files:arraysresult[0]→result[0].result(affects the print ready-state polling loop)nulltabId) → explicittarget: { tabId }from the already-queriedtabArray[0].idmatchAboutBlankdropped (no MV3 equivalent — Yahoo Mail print-popup edge case deferred; documented in the README)Build modernization
grunt-preprocesspipeline with a zero-dependencybuild.js(Node)sass(Dart Sass ^1.77.0) for SCSS compilationnpm run build/npm run cleanscripts; outputsdist/chrome/@echo/@if MODE/{version}preprocessing semantics exactlyOther
contributorsfield added crediting original authors + MV3 migrationhomepage_urlpointed to the active forkde,en,fr,pt_BR,sr); previous committeddist/only shippedenandfrVerification
npm run buildproduces a loadabledist/chrome/(14 files + 5 locale folders)chrome.tabs.executeScript/insertCSScalls in output@echo/@if/{version}directives in outputprintliminator.jsdiff vs old committed dist: only the version string changedpopup.htmldiff vs old committed dist: byte-identicalNotes
matchAboutBlankedge case (Yahoo Mail print popups) is deferred — documented in the README limitations section. Core functionality on normal pages is unaffected.