PolymerElements / font-roboto

Loads the Roboto family of fonts from Google Fonts.
5 stars 35 forks source link

External resources disallowed in Chrome Apps #5

Closed jscissr closed 9 years ago

jscissr commented 9 years ago

Recently #2 was fixed, however the font is still broken in Chrome Apps:

Refused to load the stylesheet 'https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic' because it violates the following Content Security Policy directive: "style-src 'self' blob: filesystem: data: chrome-extension-resource: 'unsafe-inline'".

Refused to load the stylesheet 'https://fonts.googleapis.com/css?family=Roboto+Mono:400,700' because it violates the following Content Security Policy directive: "style-src 'self' blob: filesystem: data: chrome-extension-resource: 'unsafe-inline'".

This CSP (Content Security Policy) cannot be changed. The only solution is to keep a local copy of the font files.

I just don't know the best way to do this. Maybe create a global setting that disables this package (just to remove the errors), and then add your own local stylesheets? Like this:

<script>
Polymer.Settings.disableExternalResources = true;
</script>
<link rel="stylesheet" href="css/roboto.css">
<link rel="stylesheet" href="css/roboto-mono.css">

Or somehow make it possible to replace this package with another which contains the font files?

jscissr commented 9 years ago

While browsing through https://github.com/PolymerElements, I discovered font-roboto-local, which was created just one day before I opened this issue. However, there is still missing a way to tell Polymer to use font-roboto-local (or not to use font-roboto). See also this stackoverflow question.

jscissr commented 9 years ago

Created a new issue there.