prmonitor
prmonitor copied to clipboard
feat: Support browser-specific manifest generation for Chrome and Firefox
Summary
Fixes #1066
This PR implements browser-specific manifest generation to support both Chrome and Firefox with Manifest V3:
- Added manifest template system: Created
manifest.template.jsonwith browser-specific keys using the pattern__{browser}__{key}(e.g.,__chrome__service_worker,__firefox__scripts) - Implemented manifest transformer: Added
scripts/transform-manifest.jsthat processes the template and generates browser-specific manifest files during build - Updated npm scripts:
- Modified webpack config to support browser-specific builds via
BROWSERenvironment variable - Added separate build scripts for Chrome and Firefox (
build:chrome-mv3,build:firefox-mv3) - mv3 means Manifest V3
- Added
build:allscript to build both browsers - Output directories are now browser-specific (
dist-chrome-mv3,dist-firefox-mv3)
- Modified webpack config to support browser-specific builds via
- Updated CI: Modified CI workflow to use
build:allinstead ofbuild - Updated .gitignore: Added
/dist-*pattern to ignore all browser-specific dist directories
Testing
Verified that the extension successfully fetches pull request lists on the following browsers:
- Floorp (12.7.0, Firefox 145.0.1)
- Arc (1.122.0 (71105), Chromium Engine Version 142.0.7444.176)
Notes
release.yml is not updated yet because I'm not familiar with the extension deployment process to Chrome Web Store and Firefox Add-ons.
After this PR is merged, please update release.yml before releasing the extension.
If helpful, here is a related reference: https://github.com/sun-yryr/prmonitor/commit/89abd46d42e6de8032b884a1101d447a408f04fd