When receiving a push message with a click_action in the notification payload, the service-worker tries to find a tab with the same url than the click_action.
If it succeeds, the service worker focus this tab.
If it fails, the service worker opens a new tab (or window).
But the url of the tab has to be exactly the same url than the click_action.
If a tab with the same origin than the click_action but with a different url (a different page, for my case in a one page application with Polymer) is found, the service worker will open a new tab instead of focusing this tab and send a message to it (to tell the application to change the page for example).
Notification payload:
{
notification: {
'title': 'Title',
'body': 'Message body',
'click_action': 'https://example.firebaseapp.com/demo/commands/'
}
}
Url of the inactive tab : https://example.firebaseapp.com/demo
I would like to take this on as it's currently affecting our project forcing to workaround it by making use of setBackgroundMessageHandler and custom notificationclick event handler. Is this worth working on or there is no intention of doing any changes here, at least as of yet?
Did you find any solution to this huge problem?
I think it could be easily resolved, instead of the equal operator (here), we could use an include instead
I will make a PR with that ๐
----- Edit
Done ๐
Hi Nicolas,
It sounds great, but where is this file located?
Shlomo Aran
054-7399-340
On Fri, Mar 20, 2020 at 11:20 AM Nicolas Delperdange <
[email protected]> wrote:
I think it could be easily resolved, instead of the equal operator (here
https://github.com/firebase/firebase-js-sdk/blob/master/packages/messaging/src/controllers/sw-controller.ts#L282),
we could use an include insteadI will make a PR with that ๐
โ
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-js-sdk/issues/390#issuecomment-601602975,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABLKC3ISCBU56SNGQZRX6EDRIMYODANCNFSM4EI5OVVQ
.
I have made the pull request, waiting for maintainers to review ๐
Hi Nicolas,
Now I realize that you are the firebase programmer.
So,
Thanks,
Shlomo;
Shlomo Aran
054-7399-340
On Fri, Mar 20, 2020 at 11:20 AM Nicolas Delperdange <
[email protected]> wrote:
I think it could be easily resolved, instead of the equal operator (here
https://github.com/firebase/firebase-js-sdk/blob/master/packages/messaging/src/controllers/sw-controller.ts#L282),
we could use an include insteadI will make a PR with that ๐
โ
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-js-sdk/issues/390#issuecomment-601602975,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABLKC3ISCBU56SNGQZRX6EDRIMYODANCNFSM4EI5OVVQ
.
Thank you so much.
Shlomo Aran
054-7399-340
On Fri, Mar 20, 2020 at 11:37 AM Nicolas Delperdange <
[email protected]> wrote:
I have made the pull request, waiting for maintainers to review ๐
โ
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-js-sdk/issues/390#issuecomment-601609365,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABLKC3PFA52GW44T2RBC5Y3RIM2NTANCNFSM4EI5OVVQ
.
Hi Nicolas,
I received a message that the issue of oenning "new page" when the origin
is the same is closed.
Is this means that it is done, or it was rejected.
It is extremely important and you wrote that it is simple to implement.
If it is done, do I need to do something in my code to get it, or is it
coming from the server?
Thanks.
Shlomo Aran
054-7399-340
On Fri, Mar 20, 2020 at 11:20 AM Nicolas Delperdange <
[email protected]> wrote:
I think it could be easily resolved, instead of the equal operator (here
https://github.com/firebase/firebase-js-sdk/blob/master/packages/messaging/src/controllers/sw-controller.ts#L282),
we could use an include insteadI will make a PR with that ๐
โ
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-js-sdk/issues/390#issuecomment-601602975,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABLKC3ISCBU56SNGQZRX6EDRIMYODANCNFSM4EI5OVVQ
.