Skip to content

Instantly share code, notes, and snippets.

@iamnewton
Created March 10, 2015 20:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamnewton/a90c96fd99c18db4e09d to your computer and use it in GitHub Desktop.
Save iamnewton/a90c96fd99c18db4e09d to your computer and use it in GitHub Desktop.
Web Notifications API
if ( window.Notification && Notification.permission !== "denied" ) {
Notification.requestPermission( function( status ) { // status is "granted", if accepted by user
var n = new Notification('Title', { body: 'I am the body text!' });
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment