wxt
wxt copied to clipboard
Add unlisted script to web_accessible_resources automatically
Feature Request
It would be nice to have the appropriate web_accessible_resources entry added automatically based on the matches property.
// main-injected.ts
export default defineUnlistedScript({
matches: ["https://example.net/*"],
main() {
// ...
},
});
The entry can probably be added with use_dynamic_url: true by default.
Perhaps HTML pages could also have something like the following for the same effect:
<meta name="manifest.matches" content="['https://example.net/*']" />
Thanks!
Is your feature request related to a bug?
N/A
What are the alternatives?
Keeping things as-is.
Additional context
N/A
I have the same issue. When I first tried to use injectScript, I didn't know that I needed to add injected.js to web_accessible_resources, and as a result, an error occurred. I would like to ask why it isn't added automatically. Since it's placed in the entrypoints directory, is it supposed to be used?