Skip to content

fix: Improve background script detection logic for analytics package - #1808

Merged
aklinker1 merged 6 commits into
wxt-dev:mainfrom
sm17p:fix-analytics-background-script
Feb 22, 2026
Merged

aklinker1 merged 6 commits into
wxt-dev:mainfrom
sm17p:fix-analytics-background-script

Conversation

@sm17p

@sm17p sm17p commented Jul 14, 2025

Copy link
Copy Markdown
Contributor

Overview

My attempt to resolve backgroundScript detection logic for analytics module based on
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background#browser_support

Manual Testing

I'm going to add this soon

Related Issue

This PR closes #1807

@sm17p
sm17p requested review from Timeraa and aklinker1 as code owners July 14, 2025 03:55
@netlify

netlify Bot commented Jul 14, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit e1085b3
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/687e3bfce2159c00081f10b7
😎 Deploy Preview https://deploy-preview-1808--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sm17p
sm17p force-pushed the fix-analytics-background-script branch 3 times, most recently from 3ef5496 to b3b2d5d Compare July 14, 2025 05:18
@sm17p
sm17p force-pushed the fix-analytics-background-script branch from b3b2d5d to e1085b3 Compare July 21, 2025 13:09
@sm17p

sm17p commented Sep 1, 2025

Copy link
Copy Markdown
Contributor Author

Anything pending from my side or any blockers to get this merged?

@PatrykKuniczak

PatrykKuniczak commented Feb 22, 2026 •

Copy link
Copy Markdown
Collaborator

@sm17p I'm not familiar with with PR, but if you want to get this merged, let's make sure, you've done all necessary request changes, then resolve those conversations, and then assign @aklinker1 one more time, because he has notification only for assing him on comments :)

And resolve conflicts

@aklinker1 aklinker1 changed the title fix: Improve background script detection logic for analytics package #1807 fix: Improve background script detection logic for analytics package Feb 22, 2026
@netlify

netlify Bot commented Feb 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 2a6d0f4
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/699b62f455f25a0008dd8ceb
😎 Deploy Preview https://deploy-preview-1808--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@aklinker1 aklinker1 mentioned this pull request Feb 22, 2026
9 tasks done
@aklinker1

Copy link
Copy Markdown
Member

I've pulled this out into a separate package, @wxt-dev/is-background (added @sm17p as a contributor on that PR as well), because this logic is useful for more than just the analytics package. Was able to simplify it a bit as well. Confirmed to be working on Chrome, Firefox, and Safari, MV2 and MV3.

Once that PR merged and released, we can pull it into the analytics package.

@aklinker1

Copy link
Copy Markdown
Member

@aklinker1 aklinker1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be good to go now. Thanks for the PR, will get this released today.

@aklinker1
aklinker1 enabled auto-merge (squash) February 22, 2026 20:12
@pkg-pr-new

pkg-pr-new Bot commented Feb 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@1808

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@1808

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@1808

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@1808

@wxt-dev/is-background

npm i https://pkg.pr.new/@wxt-dev/is-background@1808

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@1808

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@1808

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@1808

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@1808

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@1808

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@1808

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@1808

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@1808

wxt

npm i https://pkg.pr.new/wxt@1808

commit: 2a6d0f4

@codecov

codecov Bot commented Feb 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.28%. Comparing base (c9205bb) to head (2a6d0f4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1808      +/-   ##
==========================================
- Coverage   76.41%   76.28%   -0.14%     
==========================================
  Files         114      114              
  Lines        3065     3065              
  Branches      693      693              
==========================================
- Hits         2342     2338       -4     
- Misses        639      642       +3     
- Partials       84       85       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aklinker1
aklinker1 merged commit 4204724 into wxt-dev:main Feb 22, 2026
17 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for helping make WXT better!

@sm17p

sm17p commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for this @PatrykKuniczak @aklinker1. Appreciate all the effort!

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.

@wxt-dev/analytics | Firefox MV2 & MV3 | createBackgroundAnalytics execution skipped

3 participants