Skip to content
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

Self-hosted Google Fonts are not preloaded with Remove Unused CSS when the HTTPS protocol is missing #7252

Open
johan-las opened this issue Jan 27, 2025 · 0 comments

Comments

@johan-las
Copy link

Describe the bug
When Google Fonts are included without the HTTPS protocol and the 'Self-host Google Fonts' option is enabled along with the 'Remove Unused CSS' option, the non-self-hosted fonts are preloaded instead.

Here is an example of code that triggers this issue:

<link href="//fonts.googleapis.com/css?family=Lato:100,100italic,300,300italic,400,400italic,700,700italic,900,900italic&amp;subset=latin,latin-ext" rel="stylesheet" type="text/css">

Once we add the HTTPS protocol, self-hosted fonts were preloaded.

To Reproduce
Steps to reproduce the behavior:

  1. Add a Google fonts CSS without the HTTPS protocol.
  2. Add a CSS font-family using the Google fonts to an HTML element.
  3. Clear the Used CSS of the testing page.
  4. See the preload fonts, the Google fonts are loaded from https://fonts.gstatic.com

Expected behavior
We should preload the Self-hosted fonts.

Screenshots
Without the HTTPS protocol:

Image

With the HTTPS protocol:

Image

Additional context

Slack discussion: https://wp-media.slack.com/archives/C07PZNW7BJ5/p1737643980094689
HelpScout ticket: https://secure.helpscout.net/conversation/2823761415/535995?viewId=8127840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants