-
Notifications
You must be signed in to change notification settings - Fork 190
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
Add explanation about Content Security Policy when adding a background script #753
base: main
Are you sure you want to change the base?
Conversation
…d (service worker) I noticed that loading a background script failed until I add the CSP for `connect-src` because I think Vite server needs for connecting with the dev server websockets
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This is interesting! I don't have this error in my projects, but I'm glad you found a solution that works for you 😸 |
@andresgutgon was wondering if you have an example repo working for Firefox (as I'm guessing the CSP value is because of Firefox). I have the same value as you have, but I'm seeing all these errors: Not sure where that {
// ... other things
"content_security_policy": {
"extension_pages": "default-src 'self'; connect-src ws://localhost:5173;"
},
// ... other things
} |
I never tried with Firefox. I thought Firefox extensions were not the same. But as I said I never did one. |
Ah OK, cool, thank you for letting me know. Given that things work "as is" in Chrome (at least for me), and it's Firefox creating all the headaches with CSP, I thought your change is because of that as well |
What?
I noticed that loading a background script failed until I add the CSP for
connect-src
because I think Vite server needs for connecting with the dev server websocketsIssue on Vite
Here one person suggest that solution.
vitejs/vite#7590
And it worked in my case. At least now my extension background loads without error : )