chrome-extension-boilerplate-react-vite
chrome-extension-boilerplate-react-vite copied to clipboard
Trying to load "assets/js/index.js" & "assets/js/jsx-runtime.js" from web page itself
Hello, thanks for the great boilerplate.
Everything works seamlessly, but I see 2 errors in the console. Looks like trying to load assets/js/index.js
& assets/js/jsx-runtime.js
from web page itself instead from extension.
Screenshot of github.com/...
's console.
Refused to load the script 'https://github.com/assets/js/index.js' because it violates the following Content Security Policy directive: "script-src github.githubassets.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
Refused to load the script 'https://github.com/assets/js/jsx-runtime.js' because it violates the following Content Security Policy directive: "script-src github.githubassets.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
Thank you for your help.
Thank you for your contribution. We will check and reply to you as soon as possible.
Have the same problem( my manifest
{
"manifest_version": 3,
"name": "name",
"version": "3.0.0",
"description": "description",
"homepage_url": "https://homepage_url",
"options_page": "src/pages/options/index.html",
"background": {
"service_worker": "src/pages/background/index.js",
"type": "module"
},
"action": {
"default_title": "default_title",
"default_icon": "logo-48.png"
},
"icons": {
"128": "logo-128.png"
},
"content_scripts": [
{
"matches": [
"http://*/*",
"https://*/*",
"<all_urls>"
],
"js": [
"src/pages/content/index.js"
]
}
],
"web_accessible_resources": [
{
"resources": [
"assets/js/*.js",
"src/pages/shared/*.js"
],
"matches": [
"*://*/*"
]
}
],
"permissions": [
"storage",
"tabs",
"system.display"
],
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
}
}
@deld123 @ArtemEkzarho
Thank you for contributing to the project through issues.
It has been identified as a problem with the interpretation of dynamic imports inside rollup. So I added custom plugin to fix dynamic import syntax to fix the issue.
- https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite/pull/24
Would you like to check again with the latest version?
#24 fixed the issue. Thank you very much 🙏
@all-contributors please add @deld123 for bug