saabi/vminpoly

JS errors cause the library to not work

Opened this issue · 0 comments

My web page makes use of a couple of Google fonts which are referenced using link tags:

<link href="http://fonts.googleapis.com/css?family=Raleway:400,300,500,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>

On my Windows desktop running Chrome 38 the following errors propagate:

XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Raleway:400,300,500,700. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:2602' is therefore not allowed access. index.html:1
Uncaught Error! vminpoly.js:43
XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Lato:300,400,700. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:2602' is therefore not allowed access. index.html:1
Uncaught Error! vminpoly.js:43

It is difficult to confirm whether the library actually works on my desktop because Chrome 38 supports vh and vw. What I can confirm is that the correct styles are generated in the head tag.

The observable problem occurs on my Samsung Galaxy II running Chrome for Android 18. On my mobile device the polyfill simply doesn't work when those errors occur. When I remove/comment out the previously listed links - preventing the errors - the polyfill works.


My workaround is to link my Google Fonts using CSS @import instead.