chrome extension refusing to load the aws-sdk

853 views
Skip to first unread message

Richard Bernstein

unread,
Jun 25, 2019, 1:57:36 PM6/25/19
to Chromium Extensions
I am trying to make some calls to the aws-sdk.  I am getting this error:


Refused to load the script 'https://sdk.amazonaws.com/js/aws-sdk-2.481.0.min.js' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

If I recall (sorry my memory is very bad), wasn't there some CORS limitation on loading libs from a remote host?

This is in the top of my popup.html

and this is in the function that runs when I need to use the aws sdk:

var AWS = require('aws-sdk');
AWS.config.update({region: 'us-east-1'});
var lexruntime = new AWS.LexRuntime();

Hows do I fix this? Do I need to modify my manifest.json?

Harry Zachariou

unread,
Jun 26, 2019, 8:21:55 AM6/26/19
to Chromium Extensions
"content_security_policy": "script-src 'self' https://sdk.amazonaws.com/js/aws-sdk-2.481.0.min.js; object-src 'self'",

Have you tried this?
Reply all
Reply to author
Forward
0 new messages