The Notifications API shows system notifications. Request permission from a click (Firefox 72 555 + and Safari 10 refuse other requests), then create a Notification. Headless Chrome 1 denies permission, so try this in a real browser.
notifyButton.onclick = async () => {
if (!('Notification' in window) || await Notification.requestPermission() !== 'granted') return;
const note = new Notification('Build finished', {
body: '42 tests passed', icon: '/icons/ci.png', tag: 'build', // same tag replaces the old one
});
note.onclick = () => { window.focus(); note.close(); };
};new Notification() has Limited availability: Chrome for Android always throws, and iOS allows it only in Home Screen web apps. The Widely available route is registration.showNotification() in a service worker (SW Notifications), which adds action buttons and pairs with push (Push Notifications).