Home > Uncategorized > Refused to load gap://ready #Phonegap #Cordova #CSP

Refused to load gap://ready #Phonegap #Cordova #CSP

[Error] Refused to load gap://ready because it appears in neither the child-src directive nor the default-src directive of the Content Security Policy.

I noticed in an app I just updated, that the phonegap plugins were not working, (i.e. InAppBrowser), but deviceReady was getting called, so it it was ‘sort of’ working.

When I attached the remote debugger to the app from Safari I saw the error above in the console window being fired  over and over again.

The fix was to relax the CSP in the index.html, by adding

<meta http-equiv=”Content-Security-Policy” content=”default-src ‘self’ gap://ready file://* *; style-src ‘self’ ‘unsafe-inline’; script-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval'”>

You have to make sure you only have one CSP meta tag, as it will only use the first one.


Categories: Uncategorized
  1. August 10, 2017 at 8:06 am

    It’s not working dude


  2. 江伟
    November 12, 2017 at 3:18 pm

    It’s not working


  3. October 26, 2018 at 9:25 pm

    You are just using the wrong type of quotation marks there. It works great!



  1. May 22, 2017 at 9:21 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: