I'm trying to include the speedof.me library in my Chrome App to allow the user to do some bandwidth testing, but it seems that due to some security restrictions it does not allow me to load it. The error I get is:
Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self' chrome-extension-resource:". Note that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
I couldn't really find any documentation on how to get around this. I tried both including the js file in the html:
<script src="api.js" type="text/javascript"></script>
and also dynamically loading it through javascript:
$.getScript("api.js");
Both of those result in that same error message. Per suggestions in the comments I also tried modifying the content_security_policy:
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
That doesn't work since this is a packaged app and not an extension.
I tried sandboxing as well, but I had a bunch of other chrome app api logic in that page and sandboxing disables that.
Is what I'm trying to do just not feasible for a Chrome app? This is the first one I've ever done and I inherited it from someone else that never quite finished it.