Created
March 10, 2015 20:15
-
-
Save iamnewton/a90c96fd99c18db4e09d to your computer and use it in GitHub Desktop.
Web Notifications API
This file contains hidden or 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
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