Skip to content

Keep Manifest V3 features alive after the service worker stops - #16

Open
lordvorp wants to merge 2 commits into
developerish:masterfrom
lordvorp:v3-compliance
Open

lordvorp wants to merge 2 commits into
developerish:masterfrom
lordvorp:v3-compliance

Conversation

@lordvorp

@lordvorp lordvorp commented Oct 7, 2026

Copy link
Copy Markdown

Summary

  • Registers tab, window, alarm, and notification listeners when the service worker starts, so duplicate detection still runs after Chrome unloads the worker.
  • Stores last-used times in chrome.storage.session and runs auto-close with chrome.alarms instead of an in-memory setInterval.
  • Documents those choices in the README. The duplicate prompt is a notification with "Switch to existing" and "Keep both", because a service worker cannot call confirm().

Test plan

  • Load the extension unpacked and confirm the toolbar badge shows the open-tab count.
  • Open the popup and focus or close a tab.
  • Enable duplicate detection, open the same URL twice, and confirm the notification offers both choices.
  • Enable auto-close, restart Chrome, and confirm the tabJanitor alarm still exists in the extension service worker.
  • node __tests__/manifest.test.js

Made with Cursor

lordvorp and others added 2 commits October 6, 2026 20:54
Duplicate detection and auto-close were registered after async startup
and kept their state in memory, so they stopped when Chrome unloaded
the worker. Listeners now register at startup, and auto-close uses alarms.

Co-authored-by: Cursor <cursoragent@cursor.com>
…er help

The fork stays seeded from developerish/tab-count. The README names that
project as the source and credits Auto for help on the service worker fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant