You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mention the need to manually add unlisted script into web_accessible_resources if it's being injected. #536
After 2 hours of debugging, I've figured out that for an unlisted script to be injectable into the page it has to be declared in the manifest, like so:
// See https://wxt.dev/api/config.htmlexportdefaultdefineConfig({manifest: {web_accessible_resources: [{resources: ["page.js"],matches: ["<all_urls>"]}]}});
it would be good to mention this in the unlisted scripts docs or add it there automatically.
it would also maybe be worthwhile to add something like an accessible: boolean flag to unlisted scripts, that automatically adds them to the web-accessible resources for some given urls. or some other way to automate it. but if it's too much work, a mention in the docs works too.
it would also maybe be worthwhile to add something like an accessible: boolean flag to unlisted scripts, that automatically adds them to the web-accessible resources for some given urls. or some other way to automate it. but if it's too much work, a mention in the docs works too.
Hmm, for now, I'm gonna pass on this. In addition to #379, I'll create a new issue to supporting adding more manifest related options to the entrypoints.
After 2 hours of debugging, I've figured out that for an unlisted script to be injectable into the page it has to be declared in the manifest, like so:
// See https://wxt.dev/api/config.htmlexportdefaultdefineConfig({manifest: {web_accessible_resources: [{resources: ["page.js"],matches: ["<all_urls>"]}]}});
it would be good to mention this in the unlisted scripts docs or add it there automatically.
Activity
aklinker1 commentedon Mar 9, 2024
Nope, this looks correct. I'll update the docs.
KraXen72 commentedon Mar 10, 2024
it would also maybe be worthwhile to add something like an
accessible: booleanflag to unlisted scripts, that automatically adds them to the web-accessible resources for some given urls. or some other way to automate it. but if it's too much work, a mention in the docs works too.aklinker1 commentedon Mar 12, 2024
Hmm, for now, I'm gonna pass on this. In addition to #379, I'll create a new issue to supporting adding more manifest related options to the entrypoints.
docs: Mention adding unlisted scripts and pages to `web_accessible_re…
mundane799699 commentedon Jul 24, 2024
thank you, it's so useful tp help me to solve the problem.