How can we catch webview notification informations?


Hello everyone !

I’m using a webview in my electron app + node notifier for native notifications (which is better than native notification of electron).

When the website included in my webview generates push notifications, electron generates the same native ones.

So first: How to disable display of webview notifications ?
Core question: How to get the informations of this notification ? (like title, description, url on click…)

Thanks a lot !

ps: here is a website to test notifications


you can add a preloader to listen for notifications if you are using a webview to load the website.This might help you


In case anyone needs help with this.

For just disabling notifications, you’ll need to override the notification object.

var Notification = function(){};
window.Notification = Notification;

This will disable the notifications.
To fetch the content of the notifications, you can override it such that the information is passed to the main process.

var Notification = function(title,ops){
// title is the title of the notifations, ops is the config object
ipcRenderer.sendToHost(//send the objects);
window.Notification = Notification;


Are you sure you’re looking at the right console? Webviews don’t post toy the same console as renderer process.