Skip to content

Instantly share code, notes, and snippets.

@JavaScript-Packer
Created January 24, 2016 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JavaScript-Packer/4198223431c54481d792 to your computer and use it in GitHub Desktop.
Save JavaScript-Packer/4198223431c54481d792 to your computer and use it in GitHub Desktop.
Internet Browser notifications in JavaScript
!function() {
"Notification" in window ? "granted" === Notification.permission ? new Notification("Hi there from WHAK.com!") :"denied" !== Notification.permission && Notification.requestPermission(function(permission) {
"granted" === permission && new Notification("Hi there from WHAK.com!");
}) :alert("no");
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment