Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <button onclick="notifyMe()">
- Notify me!
- </button>
- <script>
- document.addEventListener('DOMContentLoaded', function () {
- if (Notification.permission !== "granted")
- Notification.requestPermission();
- });
- function notifyMe() {
- if (!Notification) {
- alert('Desktop notifications not available in your browser. Try Chromium.');
- return;
- }
- if (Notification.permission !== "granted")
- Notification.requestPermission();
- else {
- var notification = new Notification('notif anjing', {
- icon: 'https://i.pinimg.com/236x/97/9f/69/979f69785f1557b10f46bad8603fa495--crowns-inori-guilty-crown.jpg',
- body: "aso lo",
- });
- notification.onclick = function () {
- window.open("https://notifications.spec.whatwg.org/");
- };
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement