Skip to content

Conversation

@11me
Copy link
Owner

@11me 11me commented Jan 9, 2026

Summary

  • Add Chrome Web Store support with MV3 service worker architecture
  • Fix service worker wake-up race condition with retry logic
  • Fix settings persistence race condition via localStorage sync
  • Add comprehensive test coverage for new functionality

Changes

Chrome Support

  • New manifest.chrome.json for Chrome-specific configuration
  • Build script now supports --target=chrome / --target=firefox
  • Browser polyfill for cross-browser API compatibility

Bug Fixes

  • Service worker wake-up: Added retry logic with exponential backoff (50/100/200ms) for Chrome MV3 service workers that may be inactive when popup opens
  • Settings persistence: Sync settings to localStorage so page-script can access them immediately on page load, eliminating race condition where default values were used

Architecture

  • page-inject.ts now syncs settings to localStorage before injecting page-script
  • page-script.ts reads localStorage on every fetch interception (source of truth)
  • messages.ts validates responses and retries on undefined (Chrome SW issue)

Test plan

  • All 193 unit tests pass
  • ESLint clean
  • Manual test: Chrome - set keep=5, disable/enable extension, verify trimming
  • Manual test: Firefox - same scenario
  • Manual test: Chrome - page reload with extension enabled
  • Manual test: Firefox - page reload with extension enabled

11me and others added 6 commits January 9, 2026 21:48
- Add separate manifests for Chrome and Firefox
- Fix cross-browser API compatibility (browser vs chrome)
- Fix Chrome MV3 async messaging (sendResponse pattern)
- Fix CustomEvent detail passing via JSON serialization
- Add auto-reload on settings change
- Add tabs permission for reload functionality
- Add .dev marker for debug mode detection
- Add comprehensive tests (188 total)
Chrome MV3 service workers can be inactive when popup opens, causing
sendMessage to return undefined. Added exponential backoff retry logic
(50ms, 100ms, 200ms) to handle service worker wake-up delay.

- Add MESSAGE_RETRY_DELAYS_MS constant for backoff intervals
- Validate response is not undefined before returning
- Check chrome.runtime.lastError in Chrome context
- Add 5 new tests for retry scenarios
… access

Settings were not consistently applied on page reload because page-script
runs before content-script can provide config via events.

Changes:
- Add localStorage mirroring in storage.ts (syncToLocalStorage)
- page-inject.ts now syncs settings before injecting page-script
- page-script.ts reads localStorage on every getConfig() call
- .gitignore: exclude extension/manifest.json (build artifact)

This eliminates the race condition where fetch interception used
default settings instead of user-configured values.
- Build and publish both Firefox and Chrome extensions on release
- Create separate browser-specific zip files (-firefox.zip, -chrome.zip)
- Add Chrome Web Store publishing step using browser-actions/release-chrome-extension
- Update GitHub Release notes with both store links
- Document required GitHub secrets (CHROME_EXTENSION_ID, CHROME_CLIENT_ID,
  CHROME_CLIENT_SECRET, CHROME_REFRESH_TOKEN)
- Fix lint error in messages.ts for chrome.runtime.lastError typing
feat(ci): add Chrome Web Store publishing to release workflow
@11me 11me merged commit fbce3d3 into master Jan 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants