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

Update to proper MIME type #1

Open
theMikeD opened this issue Dec 22, 2014 · 2 comments
Open

Update to proper MIME type #1

theMikeD opened this issue Dec 22, 2014 · 2 comments

Comments

@theMikeD
Copy link

Great code, playing with it now in WordPress. After setting it up I noticed error like the following in the Chrome dev tools console

Resource interpreted as Font but transferred with MIME type application/x-font-woff2

Looking through the JS I noticed this

var localStoragePrefix = 'x-font-' + fontName;

Isn't the official MIME type for this without the x- part? Changing this made the errors go away.

@bdadam
Copy link
Owner

bdadam commented Dec 28, 2014

I think the actual problem is in the demo css files. They declare the @font-face with the wrong mime type. https://github.com/bdadam/OptimizedWebfontLoading/blob/master/build/fonts.woff2.css

I'll take a deeper look in a few days. Thanks for pointing out this problem.

@theMikeD
Copy link
Author

I think you're right. It turns out that I had changed it in both locations (js and css) and the warnings went away.

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

No branches or pull requests

2 participants