I'm trying to use Google Fonts and I've never had any problems, but now when I try to add the CSS file on my header I get this error on the console:
Refused to load the stylesheet 'http://fonts.googleapis.com/css?family=Whatever'
because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline'"
.
Yes, you can use them commercially, and even include them within a product that is sold commercially. Usage and redistribution conditions are specified in the license. The most common license is the SIL Open Font License.
Google Fonts are completely safe to use to enhance the design of your website. But, the extra HTTP requests to an outside server could slow down your page loading speed.
Yes, you can use Google Fonts and be GDPR compliant. The only time Google Fonts breaches the GDPR terms is when visitors need to send Google their IP address to request Google Fonts files.
All fonts are released under open source licenses. You can use them in any non-commercial or commercial project.
There are two things to fix here:
https://fonts.googleapis.com/css?family=Whatever
)https://fonts.googleapis.com
in style-src
directive and https://fonts.gstatic.com
in font-src
directive: "style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com"
If you're like me and a little confused because every answer is just saying you need to authorize a URL in a style-src
directive without showing how to do it, here's the full tag:
<meta http-equiv="Content-Security-Policy" content="style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com;">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With