23 lines
613 B
HTML
23 lines
613 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head><meta charset=utf-8>
|
|
<title>Create a notification</title>
|
|
</head>
|
|
<body>
|
|
<script src="NotificationTest.js"></script>
|
|
<script>
|
|
// Can't use top level await because of eslint limitation
|
|
// https://github.com/BenoitZugmeyer/eslint-plugin-html/issues/139
|
|
(async () => {
|
|
await NotificationTest.allowNotifications();
|
|
|
|
let swr = await navigator.serviceWorker.register("notification_empty_sw.js");
|
|
await navigator.serviceWorker.ready;
|
|
await swr.showNotification("This is a title", {
|
|
body: "This is a notification body",
|
|
tag: "sometag",
|
|
});
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|