node-notifier
node-notifier copied to clipboard
Event click open few card in browser
Hi I using Electron: 5.0.8 node-notifier 5.4.3
when the notification appears for example 3 times and the user clicks on it, then 3 tabs in the browser will open:
const url = 'https://www.google.com/'
notifier.on('click', (notifierObject, options) => {
console.log("click!");
require('electron').shell.openExternal(url);
});
console.log will also return "click!" 3 times.
Hi @major697! I noticed you commented on a couple other issues related to this, and it sounds like you've possibly gotten it taken care of. If your project happens to be open source I'd love to see what your electron setup looks like since we don't currently have any examples/setup for testing through that.
I called removeAllListeners()
on notifier before calling it again. It worked for me.
@pjebs Can you show me your code. I want see how you used removeAllListeners()
.
I actually reverted back to the standard notification that is part of electron so I can't remember.
See my comments here: https://github.com/electron/electron/issues/21610#issuecomment-569857509 which I believe is similar to what I did.
Or maybe it was something like this:???
const url = 'https://www.google.com/'
notifier.removeAllListeners()
notifier.on('click', (notifierObject, options) => {
console.log("click!");
require('electron').shell.openExternal(url);
});
@pjebs it seems like the answer works. Thank you ;)