Skip to main content
Question

Google fonts in plugin?

  • November 6, 2023
  • 1 reply
  • 854 views

Corey_O_Brien

So I am trying to add a google font to my plugin but it isn’t working. It gives me the following error when I look at the console and folks who don’t have the font already installed on their computer don’t get the font 😦 Any ideas?

Refused to load the stylesheet 'https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;600&display=swap' because it violates the following Content Security Policy directive: "style-src 'unsafe-inline' 'unsafe-eval' data: blob:". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.

I tried adding the following to the html UI page but it made the whole set of styles not work :(.

<meta http-equiv="Content-Security-Policy" content="default-src 'self';font-src fonts.gstatic.com;style-src 'self' fonts.googleapis.com" />

Corey_O_Brien

For anyone searching for this answer, I got the answer from other folks here in the community. I hadn’t added the Google URLs to the allowedDomains section of the manifest.json file.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings