Created
April 23, 2015 19:04
-
-
Save wtfaremyinitials/13935fb64b72ca795b73 to your computer and use it in GitHub Desktop.
Desktop notifications in Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function notify(message, iconUrl, onclick) { | |
if (!Notification) { | |
alert(message); | |
return; | |
} | |
if (Notification.permission !== "granted") | |
Notification.requestPermission(); | |
var notification = new Notification('', { | |
icon: ironUrl, | |
body: message, | |
}); | |
notification.onclick = onclick; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You made a mistake in the part that says
icon: ironUrl,
it should beiconUrl
notironUrl