Having the same problem as this guy but am not using .NET so I don't know what the answer to this problem is. I am using Electron.
<head>
<meta http-equiv="Content-Security-Policy" content="style-src-elem 'self' https://fonts.googleapis.com">
<meta http-equiv="Content-Security-Policy" content="font-src https://fonts.gstatic.com">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
<meta charset="UTF-8">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="index.css">
</head>
Here is the error:
Refused to load the stylesheet 'https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'style-src-elem' was not explicitly set, so 'default-src' is used as a fallback.
The question is here, 'style-src-elem'
IS explicitly set. I have no idea what is going on. Please help
Refused to load the stylesheet 'https://fonts.googleapis.com...
have a look in Firefox or Safari. You have to duplicate content fromstyle-src-elem
intostyle-src
, because some browsers do not supportstyle-src-elem
directive. – Longicorn