quickbuild
Version:
A mature, feature-complete application generator with an emphasis on speed
17 lines (13 loc) • 492 B
JavaScript
const path = require('path')
const notification = {
title: 'Notification with image',
body: 'Short message plus a custom image',
icon: path.join(__dirname, '../../../assets/img/programming.png')
}
const notificationButton = document.getElementById('advanced-noti')
notificationButton.addEventListener('click', () => {
const myNotification = new window.Notification(notification.title, notification)
myNotification.onclick = () => {
console.log('Notification clicked')
}
})