Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Service Workers from an iframe for Chrome GCM notifications for web

I want to subscribe/ unsubscribe to a service worker to get Chrome GCM Notifications on web through an iframe.

I have a working prototype which works fine while opening it directly on the browser and also from window.open javascript pop up.

But it gives a permission denied error while loading it from an iframe.

What could be wrong here and yes my origin is an http and iframe URL is https. Why cant an iframe subscribe to notifications.

like image 630
user3895143 Avatar asked Jun 24 '15 03:06

user3895143


1 Answers

I did a long search and then i got to know that this is not possible any more for security intent. You can't register a service worker from an unsecure domain or sub domain, Even if you are using IFRAME sandbox allow-same-origin then now post Chrome 43 it's not possible to register. Check out: https://github.com/slightlyoff/ServiceWorker/issues/700 https://code.google.com/p/chromium/issues/detail?id=489670

like image 115
Yogendra Avatar answered Nov 02 '22 07:11

Yogendra