New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service worker unable to communicate with the HTTPS iFrame on Firefox #95
Comments
Asked the Mozilla guys for more info @ https://bugzilla.mozilla.org/show_bug.cgi?id=1286417 |
Looks like Firefox's behavior is now spec-complaint, so this feature will intentionally not work in Firefox and may even be removed from Chrome. |
In Chrome 52+, the ServiceWorker method Fortunately, in Chrome, using the option In Firefox, this option does not return us the HTTPS iframe. Chrome is actually deviating from the spec (2.2.1):
According to this, Chrome's |
For any web push users stumbling on this issue, the best "solution" for now is to transition your site to HTTPS if possible! |
@jasonpang Can we communicate to serviceworker through this hidden https iframe ? |
Hi @prashantagarwal, In the most recent versions of Chrome, inside of the HTTPS iFrame, |
For some reason, in Firefox, Here it is working on Firefox 48.0.1: |
Now that this works again, closing the issue. |
Part of this issue seems to be open again: https://app.intercom.com/a/apps/344a89aeac3f033e4dec4370781543b948aece6d/inbox/jason@onesignal.com/conversations/5117244924. |
Closing this until we hear another report as the previous is a year old |
Hi @jasonpang I'm using OneSignal as the java webapp I'm working on is not fully HTTPS yet. I managed to make it work by putting the javascript directly into the jsp but now that I moved this code outside in a js file, I encountered what I think is related to this specific issue. From the debug log I get from the OneSignal SDK, it tries to open an iFrame to https://my-app-name.onesignal.com/webPushIframe but is not able to and times out. Do you know if the compatibility changed for newer versions of Firefox (i'm using version 60) ? And if so, is there any workaround ? Thanks in advance ! |
Our service worker communicates with the HTTPS iFrame to support events like "a notification has been displayed" and "a notification has been clicked". Technically, how this works is:
self.clients.matchAll({type: 'window'})
to get all clients (pages) the service worker controls. On Chrome, this includes nested frames (although Chrome may remove support for this in the future, bug is possibly hidden due to security issue? not sure). On Firefox, the call does not seem to include nested frames (firefox may also remove support for this). It currently isn't clear why this call on Firefox is returning an empty array of window clients due to errors not being correctly displayed in the service worker Firefox dev tools console.MessagePort
/ postMessage / a message event listener.On Chrome, all this works okay. On Firefox, due to the nested HTTPS frame not being included in
self.clients.matchAll()
, it isn't possible for the Firefox service worker to communicate with the nested HTTPS iframe.This bug:
notificationDisplay
eventThe text was updated successfully, but these errors were encountered: