{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/7797","repository_url":"https://api.github.com/repos/meteor/meteor","labels_url":"https://api.github.com/repos/meteor/meteor/issues/7797/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/7797/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/7797/events","html_url":"https://github.com/meteor/meteor/issues/7797","id":178300990,"number":7797,"title":"Cordova: Content-Security-Policy should include gap: protocol","user":{"login":"derwaldgeist","id":3984535,"avatar_url":"https://avatars0.githubusercontent.com/u/3984535?v=3","gravatar_id":"","url":"https://api.github.com/users/derwaldgeist","html_url":"https://github.com/derwaldgeist","followers_url":"https://api.github.com/users/derwaldgeist/followers","following_url":"https://api.github.com/users/derwaldgeist/following{/other_user}","gists_url":"https://api.github.com/users/derwaldgeist/gists{/gist_id}","starred_url":"https://api.github.com/users/derwaldgeist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derwaldgeist/subscriptions","organizations_url":"https://api.github.com/users/derwaldgeist/orgs","repos_url":"https://api.github.com/users/derwaldgeist/repos","events_url":"https://api.github.com/users/derwaldgeist/events{/privacy}","received_events_url":"https://api.github.com/users/derwaldgeist/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-21T10:00:17Z","updated_at":"2017-06-08T13:01:32Z","closed_at":"2017-06-08T13:01:32Z","body":"The current Content-Security-Policy defined here:\n\nhttps://github.com/meteor/meteor/blob/devel/packages/boilerplate-generator/boilerplate_web.cordova.html#L7\n\nis missing the gap: protocol. This protocol is required to enable communication between Native and JavaScript code. If it is missing and such communication is done, Safari runs into an end-less looping printing out an error message on the console every millisecond. And of course the communication fails. I faced this problem when using a Twitter Digits plugin.\n\nI could work-around this problem with these settings:\n\n```\n <meta http-equiv=\"Content-Security-Policy\" content=\"default-src * data: blob: gap: 'unsafe-inline' 'unsafe-eval' ws: wss:;\">\n```\n\nAlternatively, `gap:ready` should also work (and be more precise), since the console prints the error for this path, but I haven't tried this out.\n\nI'd recommend to add gap: in the standard. I'm still on Meteor 1.2, so I don't know if that's still an issue in newer Cordova versions, but if they still use gap:, this should be the case.\n\nIt would also be very nice if the CSP settings could be set programmatically somehow, in order to restrict them to app-specific values. Patching the boilerplate-generator is possible, but not nice. And it did not work for me. Although I placed my own boilerplate-generator package in my app and checked that it is being executed, the resulting boilerplate was still the standard one.\n"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/307096049","html_url":"https://github.com/meteor/meteor/issues/7797#issuecomment-307096049","issue_url":"https://api.github.com/repos/meteor/meteor/issues/7797","id":307096049,"user":{"login":"abernix","id":841294,"avatar_url":"https://avatars3.githubusercontent.com/u/841294?v=3","gravatar_id":"","url":"https://api.github.com/users/abernix","html_url":"https://github.com/abernix","followers_url":"https://api.github.com/users/abernix/followers","following_url":"https://api.github.com/users/abernix/following{/other_user}","gists_url":"https://api.github.com/users/abernix/gists{/gist_id}","starred_url":"https://api.github.com/users/abernix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abernix/subscriptions","organizations_url":"https://api.github.com/users/abernix/orgs","repos_url":"https://api.github.com/users/abernix/repos","events_url":"https://api.github.com/users/abernix/events{/privacy}","received_events_url":"https://api.github.com/users/abernix/received_events","type":"User","site_admin":false},"created_at":"2017-06-08T13:01:32Z","updated_at":"2017-06-08T13:01:32Z","body":"Confirmed, this was added with https://github.com/meteor/meteor/commit/eef23a30b4eda0b17467fd3b4eb7a1e9106aa43e (in PR https://github.com/meteor/meteor/pull/7934) thanks to @ramezrafla.\r\n\r\nThanks for pointing this out, @jcesarmobile!"}}
{"actor":{"display_login":"abernix"}}