antfu-collective / vitesse-webext

⚡️ WebExtension Vite Starter Template
MIT License
2.9k stars 224 forks source link

Matches on content_script dont work #116

Open capoia opened 1 year ago

capoia commented 1 year ago

Describe the bug

Hello, first of all thank you very much for your contribution, it has helped me a lot.

I need my extension to work only on a specific URL (the whatsapp one) I needed the extension not to appear on other sites, nor the popup (or be disabled to click if it is outside whatsapp)

I tried adding "matches: ["*://web.whatsapp.com/"]," inside the content_scripts but it doesn't work, how would I do that? it doesn't add any match statements to the manifest.json inside the extension folder.

There is no way to put a minimum reproduction in this case, because the "problem" happens after you put the extension in the browser

You can see my manifest.ts on the reproduction link.

As you can see, extension works on every page. CleanShot 2023-03-07 at 13 38 31@2x

Reproduction

https://stackblitz.com/github/antfu/vitesse-webext?file=src/manifest.ts

System Info

System:
    OS: macOS 13.0
    CPU: (8) arm64 Apple M1
    Memory: 78.72 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
  Browsers:
    Chrome: 110.0.5481.177
    Firefox: 110.0.1
    Safari: 16.1

Used Package Manager

npm

Validations

damevin commented 1 year ago

Hello there! Did you find a way to do that?

tmkx commented 7 months ago

the reproduction link is invalid, can u provide a new one?