Loading failed - google maps js api in add-on?

Hello,

Loading failed for the ‘script’ with source “https://maps.googleapis.com/maps/api/js”.

Content Security Policy: The page’s settings blocked the loading of a resource at https://maps.googleapis.com/maps/api/js (“script-src”).

manifest.json - “permissions”: [ “https://maps.googleapis.com/*” ]
and in html header - meta http-equiv=“Content-Security-Policy” content=“script-src https://maps.googleapis.com/;

still no effect on the errors,
What else may i try ?

Any example of an add-on that manages to display dynamic google maps with markers and zoom ?

Thanks

I’m not sure you can override your extension’s CSP with a http-equiv header. Setting it in the manifest should solve it.

I am sure you can not. This is nothing extension specific. Additional CSPs can only ever increase the restrictions (you will only be allowed to do what every single one of the CSPs permits).

Setting it in the manifest should solve it.

True, but it will also disqualify you from being listed on AMO.

You may want to embed an iframe instead.

1 Like