I want to listen to the notifications from discord with electron. and I followed this post: https://stackoverflow.com/a/59554483/13411736
Specifically, i created a pre-loaded renderer.js to override the notification
var Notification = function(title, ops) {
ipc.send("notification-show", {title: title, options: ops});
};
Notification.requestPermission = () => {};
Notification.permission = "granted";
window.Notification = Notification;
and then in the index.js, i tried to display the notification from that "notification-show" channel, and display it with a new title
const ipc = require('electron').ipcMain;
ipc.on('notification-show', function (event, arg) {
var notification = new VcpNotification("new:" + arg.title, arg.text);
notification.show();
});
but it seems it does not work at all. the title is not updated when the notifications pop up