Created
March 17, 2014 01:06
-
-
Save AleksLitynski/9592212 to your computer and use it in GitHub Desktop.
notifications only show via file, not http
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<script> | |
function show_notification(){ | |
//http://www.w3.org/TR/notifications/ | |
//tags are for shared notes. If gmail is open twice, they cannot know | |
//about each other, but if the alert for an email tries to pop up twice, | |
//but are tagged the same (via server coordiantion) they won't display | |
//twice | |
var notification = new Notification("note name", | |
{ icon: "dog.jpg", tag: "test-note-xxx", body:"note body" }); | |
notification.onclick = function() | |
{ console.log("got me") } | |
//onerror, onclose, onshow | |
//notifications.close() | |
//clicking the note seems to bring it to the fore, X-ing it doesn't | |
} | |
setTimeout(show_notification, 1000); | |
</script> | |
</head> | |
<body> | |
heh | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment