electron-main-notification
Version:
Display notifications from the electron main process
24 lines (21 loc) • 506 B
HTML
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
const { ipcRenderer } = require('electron')
ipcRenderer.on('display-notification', (event, arg) => {
var notification = new Notification (arg.title, arg.opts)
notification.onclick = () => {
ipcRenderer.send('display-notification-onclick', arg.uid)
}
notification.onclose = () => {
ipcRenderer.send('display-notification-onclose', arg.uid)
}
})
</script>
</body>
</html>