Repository navigation
Modernize browser extensions with prebuilt packages and shared popup - #624
Conversation
|
How is this new popup show? Is it overlaid to the page itself? |
| matrix: | ||
| node-version: [26.x] | ||
| os: [ubuntu-latest, windows-latest] | ||
| node-version: [24.x, 26.x] |
There was a problem hiding this comment.
This test runs on a single version of node as test-detection is a heavy test that downloads a lot of files to test the repo. This test does not need to be run across multiple OSes and node versions. There will need to be a split
There was a problem hiding this comment.
Moved test-detection.js and its cache into a separate ubuntu-latest / Node 24 job. The other checks remain in the OS/Node matrix.
|
The previous version of the prebuilt chrome extensions also bundle the repository, allowing it to be used with a slightly stale version of the repository even if it cannot download a new version. Use case is copying it in to a network without internet access or where access to github is blocked. |
42be9e8 to
c790318
Compare
|
By "popup", I mean the existing extension window that opens when you click retire.js in the browser's top-right toolbar or Extensions menu. This PR redesigns that window; it does not inject anything into the web page. The screenshot below shows the whole Chrome window, including the toolbar button and its native popup, on a local test page. GitHub access was blocked to verify detection using the bundled repository on a fresh profile. All three prebuilt packages already bundle the advisory repository. I added a regression test for first-launch detection without a cached repository or a successful update, and documented the fallback. Chrome, Chrome no-func, and Firefox browser checks passed. All six PR commits now have verified signatures. Validation: 62 Node tests, 17 extension tests, all 48 detection packages, build, typecheck, and ESLint passed. |
|
Where are the prebuilt extension packages? |
eoftedal
left a comment
There was a problem hiding this comment.
This is getting close, but till some adjustments needed
|
Moved the prebuilt-package check to a separate job using the PR head commit, so newer advisory data from master does not cause a false mismatch. The existing test matrix still runs against the merge result. No application code changed. |
|
It would be preferable if the chrome finished chrome extensions stayed in their original locations rather than in a generic dist folder. People are often using the repository directly, and a git pull would break this as the location is swapped. I would rather we move the build files into a separate folder (chrome/build). |
|
Kept the Chrome extensions at their original paths, moved the sources into |
|
Version number is misaligned vertically (see green line). The numbers are context-less. Is "6 vulnerabilities" 6 high? 2 medium? 0 low? The header line must say how many of each. |
|
Also I want to drop the storage. It introduces complexity. You can simply reload the page to scan again. It is cheap. This appears to introduce "per tab" storage of vulnerabilities, while the intention is per top level navigation. |
|
Once this is done we can also close #428 |
|
Updated table alignment, header severity counts and per-library count pills; removed the redundant scan-mode label and persisted scan state. The refreshed dark palette keeps the teal accent and separates severity colors; only numbers are colored in the header. All three packages rebuilt; extension tests and Chrome/Firefox checks passed. Commit Full Chrome window with the native toolbar popup; nothing is injected into the page. Detection here uses bundled data with repository network access blocked. |
|
@eoftedal Can you review if you have free time and let me know if any changes needed? |
This is still open |
|
|
@eoftedal checking in to see if you have any updates or would like any further changes. |
Refresh discards the current tab's results and rescans the scripts seen since the last top-level navigation, using the current settings. Results stay in memory only; a reload is still needed after a background restart. Renew the popup screenshots for the current UI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@eoftedal a few updates:
|
The Chrome check read the popup's severity summary as soon as the background reported results, before the popup (which polls once per second) had rendered them, so the later unfiltered-count comparison failed with all-zero counts. Read it after the popup shows its rows. Firefox 159 requires MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1 in addition to --remote-allow-system-access before chrome-context Marionette calls. CHROME_PATH and FIREFOX_PATH override the default Windows install locations so the checks also run on Linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new docs/images/popup folder has each popup screen in light and dark, captured from the real extension scanning real library builds, plus the whole Chrome window with the toolbar popup open. The old single-theme screenshots of the previous popup are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The popup opens on a summary of the page: advisories by severity, search, and libraries grouped into vulnerable, no known findings, scanning and other scripts. Selecting a library slides in its details: URL with Copy URL, how it was detected, and each advisory with its affected range and references. Scanning, Deep scan, Show unidentified scripts and Export JSON move to an options sheet. The header keeps per-severity counts and rows keep numbered per-severity pills. The popup follows the system light or dark appearance with a navy and teal palette carried over from the previous popup, shows the retire.js icon (gray while scanning is disabled), and meets WCAG AA contrast in both themes. Unidentified and failed scripts are listed by file name, and rows that share a name show their file. Advisory text is still rendered as text, and links are still limited to HTTP(S). The smoke checks open a library before Copy URL and the sheet before Export, wait for an identified library rather than any row text, and capture the detail view. The toolbar icons are Font Awesome Free (CC BY 4.0), with the attribution comment kept in the markup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@eoftedal I redesigned the popup. The runtime, storage, and packaging are unchanged:
Extension tests (26), Node tests (102), and the Chrome, Chrome no-func, and Firefox smoke checks pass, and all three packages are rebuilt. The PR description has the full browser window in light and dark; every screen is in Library details, light: Options, dark: |
Results live only in background memory, so a tab loaded before the worker started (extension reload or install, or the browser stopping the idle worker after about 30s) showed nothing until the page was reloaded. When a tab is activated, the popup opens on it, or it is the active tab when the worker starts, and the runtime did not watch it load from its top-level navigation, it now waits 3 seconds for late scripts, then reads the scripts the page actually loaded (performance resource entries, all frames) and scans them through the existing path. URLs already seen through webRequest are merged in. Refresh uses the same path, so it also recovers scripts loaded before the worker started, and it keeps requests that are still downloading. This needs the scripting permission, which an earlier change ruled out for Refresh. It is justified now because scanning open tabs without a reload needs it. <all_urls> is already granted, so it adds no new install warning. Results still stay in memory only. Only resources the browser fetched are used, not <script src> values, so a page cannot make the extension request URLs it never loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rotate-left icon points anticlockwise but reused the clockwise spinner keyframes. Reverse the animation for the icon only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Two new commits: 00e8ee7 Scan already-open tabs on tab switch without a reload Results still live only in background memory. Before this, a tab loaded before the worker started (extension reload or install, or the browser stopping the idle worker after about 30s) showed nothing until you reloaded it.
a79db61 Spin the Refresh icon anticlockwise to match its arrow The prebuilt packages are rebuilt in both commits, and the extension tests pass (32). |
|
Sorry this is taking so long, but massive PRs are hard to review, especially then things are changed. The original idea here was to capture requests are they were loaded and scan as they were loaded. Some pages may load scripts later (e.g. Vue's dynamic loading). I'm not sure why waiting 3 seconds is needed, if it responds to scripts being loaded, rather than query something after the fact. I spend some time on reviewing this soon, but the last weeks have been super busy, and I have not really had time to review all the new work. Smaller PRs are easier to review, so maybe limit changes to what is required from review, so we can get the first version merged. Thanks for doing this, btw |
| - run: node validate | ||
| working-directory: repository | ||
|
|
||
| prebuilt: |
There was a problem hiding this comment.
This should not run on repository only updates, as the extension will normally auto-update the repository on first load.
|
@copilot resolve the merge conflicts in this pull request. Merges in this file should not be solved individually. Pull in the latest changes from main, and run the generation script to generate a new version of the conflicting file. |
Resolve README conflict, bump the Chrome source manifests to 6.1.1 to match master, and regenerate the prebuilt extension packages. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>







Browser scans could lose or mix results across navigation and background restarts. This PR shares a runtime and popup across Chrome, Chrome without function scanning, and a modern Firefox WebExtension, with stale-result rejection, detector refresh with cached fallback, and regression coverage.
Scan results are kept only in background memory, per top-level navigation: they reset when the page navigates, when the tab closes, or when the background restarts. No scan state is stored. Only settings and repository updates use
storage.local.Popup
The popup is the existing toolbar window (600×600); nothing is injected into the page. It follows the system light or dark appearance and shows the retire.js icon, which turns gray while scanning is disabled, like the toolbar icon.
Text and controls meet WCAG AA contrast in both themes. Advisory text is rendered as text, and links are limited to HTTP(S).
Ready to load without Node
Complete prebuilt packages are committed in
chrome/extension,chrome/extension-no-func, anddist/firefox. Download and extract the repository ZIP, then load the appropriate package. Node is needed only for development. Firefox uses temporary add-on installation, which lasts until browser exit.The Chrome packages retain their original paths so existing installations loaded directly from the repository continue to work after
git pull. Shared extension sources and build files live underchrome/build.The development instructions recommend Node 24 LTS. Portable build/test scripts support Windows and Linux, and CI covers Node 24 and 26, including a rebuild check for committed packages. The added
--no-audit/--no-fundflags are removed. Generated files are marked as such for review.The prebuilt service workers bundle
repository/jsrepository-v6-combined.json, so the packages must be rebuilt after merging repository updates from master.Actual popup screenshots
Captured on November 3, 2026 in Chrome 156 with the real toolbar popup, on a local example page that loads real builds of AngularJS 1.5.0, Chart.js 2.6.0 (which bundles moment.js 2.18.1), Highcharts 4.2.4, jQuery Validation 1.15.1, ECharts 6.0.0, and Bootstrap 5.0.0. These are version matches, not exploit confirmations. Firefox shares the UI. Every popup screen, in light and dark, is in
docs/images/popup.Validation and compatibility
CHROME_PATH/FIREFOX_PATHis set.This is the extension-only replacement for #622. The branch is synced with upstream master (
970fc88), including the merged CLI and CycloneDX fixes. No browser-store publishing is included. The toolbar icons in the popup are Font Awesome Free (CC BY 4.0), with the attribution kept in the markup. AI-assisted implementation.Related merged replacements: CLI fixes #623 and CycloneDX #625. Completing this also covers #428 (upstreaming the third-party plugin).
🤖 Generated with Claude Code