Repository navigation
Conversation
The browser stops the idle background after about 30 seconds, but keeps the badge. Results lived only in background memory, so opening the popup on a tab whose badge showed findings started an empty worker, cleared the badges, waited 3 seconds and downloaded every script again. A passive content script now keeps a copy of the tab's results in the page. A restarted background restores from it before answering the popup, so the first snapshot already has the results and nothing is downloaded again. The copy is per document: it is gone on navigation, tab close and extension reload. No storage API is used. Tabs without a copy (opened before the extension was installed or reloaded) still use the existing 3 second wait and rescan. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
The toolbar badge shows a number, but opening the popup shows an empty list and scans the page again.
The browser stops the idle background after about 30 seconds (the service worker in Chrome, the event page in Firefox). Results lived only in background memory, so they were lost, while the browser kept the badge. Opening the popup started a new background, which cleared every badge, waited 3 seconds and downloaded all of the page's scripts again.
Change
A small content script keeps a copy of the tab's results in the page. When the background has no results for a tab, it asks the page first.
content.js).No new permission is needed. The content script matches
http://*/*andhttps://*/*, which<all_urls>already covers.Testing
cd chrome/build && npm test). New:content.test.cjsand the restart cases inruntime.test.cjs.browser-smoke.cjshas a new step: it stops the service worker, opens the popup again and checks that the same libraries are listed, the badge is unchanged and no script is requested again. It passes in Chrome 158 for both Chrome packages.node/lib/retire.jschange from da66c52, which the prebuilt packages on master do not have yet.AI-assisted implementation.
🤖 Generated with Claude Code