aws sdk in chrome extensions v3 manifest

176 views
Skip to first unread message

Kethan Sai

unread,
May 23, 2022, 12:26:08 AM5/23/22
to Chromium Extensions
Hey,

I was hoping see if it is possible to import aws sdk script. I tried to add
content_security_policy": {
    "extension_pages": " script-src 'self' https://sdk.amazonaws.com/js/aws-sdk-2.481.0.min.js; object-src 'self' "
}

but I get the error:  Refused to load the script 'https://sdk.amazonaws.com/js/aws-sdk-2.831.0.min.js' because it violates the following Content Security Policy directive: "script-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

is there any work around or method to perform sdk calls inside chrome extension contentScript.js.

Oliver Dunk

unread,
May 23, 2022, 10:08:15 AM5/23/22
to Chromium Extensions, yketh...@gmail.com
Hey,

In general Chrome extensions are moving away from allowing any dynamic code execution, so loading a script like that probably isn't going to work. I would give bundling the script locally and loading it from the extension a try :)

Kethan Sai

unread,
May 24, 2022, 11:36:22 PM5/24/22
to Chromium Extensions, oli...@oliverdunk.com, Kethan Sai
will try it out. was checking into this tool too: https://github.com/dutiyesh/chrome-extension-cli#readme
Reply all
Reply to author
Forward
0 new messages