{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1235","repository_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1235/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1235/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1235/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/1235","id":178292121,"number":1235,"title":"SecurityError: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).","user":{"login":"KevinWessels","id":8044567,"avatar_url":"https://avatars.githubusercontent.com/u/8044567?v=3","gravatar_id":"","url":"https://api.github.com/users/KevinWessels","html_url":"https://github.com/KevinWessels","followers_url":"https://api.github.com/users/KevinWessels/followers","following_url":"https://api.github.com/users/KevinWessels/following{/other_user}","gists_url":"https://api.github.com/users/KevinWessels/gists{/gist_id}","starred_url":"https://api.github.com/users/KevinWessels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KevinWessels/subscriptions","organizations_url":"https://api.github.com/users/KevinWessels/orgs","repos_url":"https://api.github.com/users/KevinWessels/repos","events_url":"https://api.github.com/users/KevinWessels/events{/privacy}","received_events_url":"https://api.github.com/users/KevinWessels/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/browser","name":"browser","color":"BFD4F2"},{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-21T09:23:26Z","updated_at":"2016-09-21T14:01:33Z","closed_at":null,"body":"### Expected Behaviour\r\nCalling PushNotification.init sets up everything needed for push notifications, regardless of platform\r\n\r\n### Actual Behaviour\r\nCalling PushNotification.init sets up everything needed for push notifications for iOS, but fails in chrome\r\n\r\n### Reproduce Scenario (including but not limited to)\r\nthis:\r\nvar push = PushNotification.init({\r\n            \"android\": {\r\n                \"senderID\": \"XXXXXXXX\"\r\n            },\r\n            \"browser\": {},\r\n            \"ios\": {\r\n                \"sound\": true,\r\n                \"vibration\": true,\r\n                \"badge\": true\r\n            },\r\n            \"windows\": {}\r\n        });\r\nproduces:\r\n\"SecurityError: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).\"\r\nerror in phonegap CLI and:\r\n\"DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).\"\r\nin browser console\r\n\r\n#### Platform and Version (eg. Android 5.0 or iOS 9.2.1)\r\nChrome 53.0\r\n\r\n#### Cordova CLI version and cordova platform version\r\n6.3.3\r\nbrowser 4.1.0\r\n\r\n#### Plugin version\r\n1.8.2\r\n\r\n#### Sample Push Data Payload\r\n\r\n#### Sample Code that illustrates the problem\r\nvar PushInterface = {\r\n\r\n    register: function() {\r\n        console.log(\"Trying to register for push notifications\");\r\n\r\n        var push = PushNotification.init({\r\n            \"android\": {\r\n                \"senderID\": \"XXXXXXXX\"\r\n            },\r\n            \"browser\": {},\r\n            \"ios\": {\r\n                \"sound\": true,\r\n                \"vibration\": true,\r\n                \"badge\": true\r\n            },\r\n            \"windows\": {}\r\n        });\r\n\r\n        if (push) {\r\n            console.log(\"Got push object\");\r\n\r\n            // configure push event 'registration' \r\n            push.on(\"registration\", PushInterface.onRegistration);\r\n\r\n            // configure push event 'error'\r\n            push.on(\"error\", PushInterface.onError);\r\n\r\n            // configure push event 'notification' \r\n            push.on(\"notification\", PushInterface.onNotification);\r\n        }\r\n    },\r\n\r\n    onRegistration: function(e) {\r\n    },\r\n\r\n    onNotification: function(e) {\r\n    },\r\n\r\n    onError: function(e) {\r\n    },\r\n};\r\n#### Logs taken while reproducing problem\r\nphonegap CLI:\r\n[phonegap] [console.log] device is ready\r\n[phonegap] [console.log] Trying to register for push notifications\r\n[phonegap] [console.log] Got push object\r\n[phonegap] [console.log] SecurityError: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).\r\n\r\nChrome console:\r\nTrying to register for push notifications\r\n(index):111 Got push object\r\n(index):111 DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).\r\npush.js:80 Uncaught (in promise) Error: Error registering Service Worker(…)(anonymous function) @ push.js:80"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/comments/248621352","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/1235#issuecomment-248621352","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1235","id":248621352,"user":{"login":"macdonst","id":353180,"avatar_url":"https://avatars.githubusercontent.com/u/353180?v=3","gravatar_id":"","url":"https://api.github.com/users/macdonst","html_url":"https://github.com/macdonst","followers_url":"https://api.github.com/users/macdonst/followers","following_url":"https://api.github.com/users/macdonst/following{/other_user}","gists_url":"https://api.github.com/users/macdonst/gists{/gist_id}","starred_url":"https://api.github.com/users/macdonst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macdonst/subscriptions","organizations_url":"https://api.github.com/users/macdonst/orgs","repos_url":"https://api.github.com/users/macdonst/repos","events_url":"https://api.github.com/users/macdonst/events{/privacy}","received_events_url":"https://api.github.com/users/macdonst/received_events","type":"User","site_admin":false},"created_at":"2016-09-21T14:01:33Z","updated_at":"2016-09-21T14:01:33Z","body":"@KevinWessels yeah, service workers are only accessible via https in chrome. SW are required for browser push. The easiest way around it is to go to `http://localhost:3000` instead of the IP address of the computer you are running `phonegap serve` on."}}
{"actor":{"display_login":"macdonst"}}