google maps api script does load due to content security policy

I am making a google chrome extension where I want to use google maps. The problem is that when I run my script then it gives me this error

Refused to load script from '' because of Content-Security-Policy.

Here is my manifest file

  "name": "Name",
  "version": "1.0",
  "manifest_version": 2,
  "background": { 
    "scripts": [
  "description": "Desc",
  "browser_action": {
    "default_icon": "images/icon.png",
    "default_title": "Title",
    "default_popup": "html/popup.html"
  "permissions": [ 
  "content_security_policy": "script-src 'self'; object-src 'self'"


And I am adding my scripts like this

<script src="../js/libs/jquery.js"></script>
  <script type="text/javascript" src=""></script>
  <script src="../js/plugins/easing.js"></script>
  <script src="../js/script.js"></script>

Why am I getting that error again and again? Please help...

Update one

I added these two permissions to manifest file but still not working


Update two

I also used this sort of content_security_policy

"content_security_policy": "default-src 'none'; style-src 'self'; script-src 'self'; connect-src; img-src"

But above doesnt work for me either


I think the problem here is that you have not correctly set the content security policy for Google Maps URL. You should change your "content_security_policy" in manifest file to something like this:

"content_security_policy": "script-src 'self'; object-src 'self'"

This simply means that you are allowing to run script from the self/current page, and from the "".

Try this, and see if it helps.

I had a same issue and solved by replacing API URL from http to https version.

In HTML From:

<script type='text/javascript' src=''></script>


<script type='text/javascript' src=''></script>

Then added to CPS in manifest.json

I don't know if you still need this info. But I was googling and spend some time but couldn't find a direct answer, so I wrote here to hope if it helps anyone.

Content Security Policy keeps you in safe from XSS attacks. But it means you need to whitelist external resources explicitly. You can make it by providing additional HTTP headers or by <meta> tag like:

<meta http-equiv="Content-Security-Policy" 
    content="default-src 'self' data: gap: ws: ; 
    style-src 'self' https: *; 
    script-src 'self' https: *;
    media-src 'none'; 
    font-src *;
    connect-src *;
    img-src 'self' data: content: https: *;"> 

Need Your Help

Copy an cv::Mat inside a ROI of another one

c++ opencv copy roi

I need to copy a cv::Mat image (source) to an ROI of another (Destination) cv::Mat image.

CSS media queries for Galaxy S3

css html5 media-queries responsive-design

Anyone know how to target the Samsung Galaxy S3 with media queries?