Skip to content

Instantly share code, notes, and snippets.

@jasonrhodes
Last active August 29, 2015 14:00
Show Gist options
  • Save jasonrhodes/11384085 to your computer and use it in GitHub Desktop.
Save jasonrhodes/11384085 to your computer and use it in GitHub Desktop.
Web Notifications API in Chrome, example
document.getElementsByTagName("body")[0].onclick = function () {
Notification.requestPermission(function (p) {
var n = new Notification("WHAO!", {
icon: "http://www.yuppiepunk.org/images/brotherly_love.jpg",
body: "Joey Lawrence is totes cool"
});
console.log(n);
});
};
@jasonrhodes
Copy link
Author

The only website that had instructions that seemed to work, as of today: https://developer.mozilla.org/en-US/docs/Web/API/notification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment