Notification is not shown if multiple tabs are opened in Firefox.

Notification is not shown if multiple tabs are opened in Firefox. It is working fine with Chrome. Have any solutions for that?

Is this an issue with Firefox, or with this lbrary?

Not sure. If I add any alert in 'Notify.prototype.show' function then it shows the notification.

Are you saying the issue is if you have more than one tab open, each using Notify.js? Or is the issue if the tab using Notify.js isn't the one in focus?

I am using Asp.Net MVC. 'notify.js' is called on layout.cshtml page. we are using this for showing notification while other users login.

I am using Asp.Net MVC. 'notify.js' is called on layout.cshtml page. we are using this for showing notification while other users login.

That doesn't really answer my question I'm afraid. Can you provide a demonstratable test case of the issue?

Link to Project

I have no idea how to run or install this (I'm not on Windows). Please provide a simple, reduced test case that demonstrates the problem outside of all the dependencies of your project).

OK, I think I have a simple test case:
1.) load tab 1: https://alexgibson.github.io/notify.js/
2.) load tab 2: https://alexgibson.github.io/notify.js/
3.) In tab 2, click "Notify me" and then grant permission for the site.
4.) In tab 1, click "Notify me" and the following error is shown:
"Error: You must only call this before calling Notification.requestPermission(), otherwise this feature detect would trigger an actual notification!"
Is this the issue you're trying to describe?

isSupported function is not calling in our demo.

Ok, then please provide a test case for the issue please.

Just check what happening when two simultaneous call of doNotification method in index.html  (example folder in your project). i.e. doNotification(); doNotification();

Just check what happening when two simultaneous call of doNotification method in index.html (example folder in your project). i.e. doNotification(); doNotification();

If I use the following code:
var myNotification = new Notify('Yo dawg!', {
    body: 'This is an awesome notification',
    tag: 'My unique id',
    timeout: 4
});

myNotification.show();
myNotification.show();

The notification shows once, which is correct since they both use the same ID.
Again, it would be really helpful if you could provide some code to demonstrate your issue.

I will explain my scenario.
We have users logined in our application. If one user is logined the other user should notify it.
So we are using the signalR for pushing these login information to other users(Clients - browsers). once the information is received at client we are calling the notification to notify the user.
In some cases user may be opened two or more tabs of the same application. That time SignalR send login details to all the tabs of all clients except the logined user. All tabs read this and will create the notification. This time in Firefox the notification is not showing for any of the tabs. All these notification call will be on the same time.
We tried with different tag for different tabs, but result is negative. I strongly feel this is happened because of two call at the same time. may be one destroys another.
In my uploaded project you can recreate these scenario. But Im unlucky that you are not from windows side.
If you can please recreate the scenario  that two tabs calls the same notification function simultaneously.
When I call doNotification() twice I got some shadow of the notification window on Top side of the window. Link to error on multi call

Sorry, but I can't install your project - If you would like help fixing this issue then please provide a simple html/js demo that shows the issue. Without that it's hard to say if this is a web sockets issue or an issue with firefox, or an issue with this library.

Does the issue still occur if you just use the regular Web Notification API, and remove dependency on this library? If so, the issue is either with your implementation or an issue in Firefox.

Let me check
On Apr 24, 2017 7:25 PM, "Alex Gibson"<EMAIL_ADDRESS>wrote:

Sorry, but I can't install your project - If you would like help fixing
this issue then please provide a simple html/js demo that shows the issue.
Without that it's hard to say if this is a web sockets issue or an issue
with firefox, or an issue with this library.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/alexgibson/notify.js/issues/77#issuecomment-296675996,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AamJSMLY_S2dNr_IrKOtlqsIc2i-TIMYks5rzKnMgaJpZM4NFDKu
.

Please download this link A link to html file

Please download this link A link to html file

This isn't an HTML file

A simple Gist would also do

Please check this

Great - thanks! Can you please give some steps to reproduce the bug. I have opened two tabs, and each shows one notification on load as I would expect.

Open in one tab.
instead of button event I just called a function at page load.(document.ready). There is two function call at bottom of document.ready

Please check the Notify error.png file for the result what I received.

OK, so can you say what the expected/actual results should be? I don't see anything wrong

are you able to see the notification in Firefox?

Is your bug that the notification is showing off screen?
As for error.png, the console logs look correct - you're firing two notifications with the same tag ID, so the browser will only show one notification (to prevent spamming the users). The 4 second delay on calling close is happening because you are passing a timeout of 4 seconds.

Have you also tried removing this library and recreating the bug on it's own like I suggested?

But the notification is showing on top. We can only see the shadow of the notification( Please check the arrow mark to top)

Yes , I have tested with native Notification also. But there also same result. But the shadow also not visible.

Yes , I have tested with native Notification also. But there also same result. But the shadow also not visible.

OK, so this is not an issue with Notify.js - please open a Firefox bug over on bugzilla (choose the 'Notifications and Alerts' component). If you want it fixed, it really helps to provide clear steps to reproduce the bug, and a simple test case.

I'm going to close this, as it's not an issue with the library - good luck in getting it fixed!

Ok alex, thank you

oh this is a bug in Firefox. and these bug logged around 10 years before. Still these guys are not solved it.
link