Loading Fonts in Chrome App (or by accessing local html file)

时间:2015-07-08 15:53:58

标签: css google-chrome-app

I've found that when loading the html file in a Chrome App or by accessing that html file in the browser, that the following error occurs. A similar error happens with loading svgs in an <img> element. Seems to be due to no headers.

Font from origin 'chrome-extension://okpiaeehdihhhafnpfhlgpkdpolplphn' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

CSS used to load the font:

@font-face {
    font-family: DINEngschrift;
    src: url(DINEngschrift.ttf);
}

#mytext {
   font-family: 'DINEngschrift';
}

Is there a simple solution to this in building Chrome Apps that I'm unaware of?

0 个答案:

没有答案