Created
February 24, 2011 23:16
-
-
Save snay2/843099 to your computer and use it in GitHub Desktop.
Simple Chrome desktop notifications
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
<html> | |
<head> | |
<title>Testing Chrome desktop notifications</title> | |
<script type="text/javascript" language="javascript"> | |
var icon = 'http://farm1.static.flickr.com/79/245536726_94521c750d_s.jpg'; | |
function showPopup() { | |
window.webkitNotifications.requestPermission(function() { | |
var popup = window.webkitNotifications.createNotification( | |
icon, 'Message Title', 'Message body'); | |
popup.show(); | |
}); | |
} | |
</script> | |
</head> | |
<body> | |
<a href="#" onclick="showPopup();">Show me a notification!</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment