Refused to load the font 'data:font/woff.....'it violates the following Content Security Policy directive: "default-src 'self'". Note that 'font-src'
For me it was because of the Chrome extension 'Grammarly'. After disabling that, I did not get the error.
Electron: Google Fonts violates Content Security Policy
Easiest way would probably be to set a Content-Security-Policy meta tag in the header of your template like this:
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self';
script-src 'self';
font-src 'self' https://fonts.gstatic.com;
style-src 'self' https://fonts.googleapis.com">
<!-- ...other stuff... -->
</head>
Guide on how to use these is here:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#multiple_content_security_policies
I'm currently in my first hours of electron myself, without react for now, and that's how I got around it and I think that's how you're supposed to do it.
Refused to load the image because it violates the following Content Security Policy directive: "default-src 'none'"
You have status code 500 Internal Server Error Server
, but not 200 OK
. In this case NodeJS runs the finalhandler which publish the default CSP: Content-Security-Policy: default-src 'none'
for security reasons.default-src 'none'
blocks all resourses include images.
I guess you have /favicon.ico
blocked, browsers loads it by default from the web pages root /
, here is a similar issue was solved.
You need to fix 500 Internal Server Error Server
.
Refused to load the script because it violates the following Content Security Policy directive
It was solved with:
script-src 'self' http://xxxx 'unsafe-inline' 'unsafe-eval';
Related Topics
Push Objects into an Array in Reactjs
Count the Number of Times a Same Value Appears in a JavaScript Array
How to Prevent the Keyboard from Popping Up on Mobile Devices
Nodejs MySQL Get Correct Timestamp Format
Have a Div Move on Scroll Up and Down
Text Box to Appear When a Radio Button Is Selected
Reload Table After Deleting an Item from It With React
How to Redirect to Another Page in Reactjs When a If Condition Is Executed
Executing Nodejs Script File in PHP Using Exec()
Get Array of Values from Multiple Inputs Using Jquery
How to Use Owl Carousel Vertically
Remove Time from Gmt Time Format
Generate Child Row Under a Parent Row in HTML Table
How to Bind Dynamic Check Boxes Value Using Ng-Model
How to Mock the JavaScript Window Object Using Jest
How to Disable and Enable a Click Event on a Table Td
How to Change Background Opacity When Bootstrap Modal Is Open