Skip to content

fix(manifest): keep content_script matches unsorted #1806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kachkaev
Copy link
Contributor

@kachkaev kachkaev commented Jul 13, 2025

Overview

I’ve noticed that URL patterns in matches end up being sorted. This affects what extension users see in the store, so sorting may be therefore undesired. For example, if we have

www.example.com
m.example.com
another-less-important-example.com

, users will end up being presented with

another-less-important-example.com
m.example.com
www.example.com

That's somewhat less logical than the original sequence.

Manual Testing

I tested the changes locally via pnpm patch.

Related Issue

I haven’t found or created one. The change is quite small so felt worth a PR right away. If you disagree with the idea, feel free to ignore this change. pnpm patch gives a good enough workaround, so the issue is not blocking.

PS: Pretty impressed with wxt, great project!

Copy link

netlify bot commented Jul 13, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit b0f2640
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/688f620fe95f97000845b31d
😎 Deploy Preview https://deploy-preview-1806--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.

Copy link

pkg-pr-new bot commented Jul 24, 2025

Open in StackBlitz

@wxt-dev/analytics

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

@wxt-dev/auto-icons

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

@wxt-dev/browser

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

@wxt-dev/i18n

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

@wxt-dev/module-react

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

@wxt-dev/module-solid

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

@wxt-dev/module-svelte

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

@wxt-dev/module-vue

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

@wxt-dev/runner

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

@wxt-dev/storage

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

@wxt-dev/unocss

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

@wxt-dev/webextension-polyfill

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

wxt

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

commit: b0f2640

@kachkaev kachkaev changed the title Keep content_script matches unsorted in manifest fix(manifest): keep content_script matches unsorted Jul 24, 2025
@aklinker1
Copy link
Member

aklinker1 commented Aug 3, 2025

I'm good with this change as long it doesn't cause tests to become flakey in this repo (the only reason I sort everything lol, things start failing real fast if you don't ensure an order).

Patching works, but if you don't want to deal with conflicts with the patch when upgrading WXT, you could use the build:manifestGenerated hook in your config or a WXT module to update the manifest how you want: https://wxt.dev/guide/essentials/config/hooks.html

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.

3 participants