Skip to content

Instantly share code, notes, and snippets.

@tobbbe
Last active November 4, 2015 10:13
Show Gist options
  • Save tobbbe/47b151a5a0fffacccb46 to your computer and use it in GitHub Desktop.
Save tobbbe/47b151a5a0fffacccb46 to your computer and use it in GitHub Desktop.
cordova-whitelist-plugin
install plugin
ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git
in config.xml
<access origin="https://foo.se/api/*"/>
in index.html
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com foo.se https://foo.se; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';">
<!--http://www.raymondcamden.com/2015/05/25/important-information-about-cordova-5-->
<!--http://content-security-policy.com/-->
content of the meta tag can be read as:
default-src 'self' data: foo.se https://foo.se;
style-src 'self' 'unsafe-inline';
script-src 'self' 'unsafe-inline' 'unsafe-eval';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment