Created
June 14, 2014 13:55
-
-
Save colinfrei/48476f365ee8f451534c to your computer and use it in GitHub Desktop.
SMS Notifier
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<div id="stuff"></div> | |
<button id="button">fdoo</button> | |
<script type="text/javascript"> | |
var xmlhttp; | |
// from https://developer.mozilla.org/en-US/docs/Web/API/notification | |
navigator.mozSetMessageHandler('sms-received', function onSMS(sms) { | |
xmlhttp = new XMLHttpRequest(); | |
xmlhttp.open("POST", "http://labs.colinfrei.com/gotSms", true); | |
xmlhttp.send(); | |
}); | |
</script> | |
</body> | |
</html> |
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
{ | |
"name": "SMS Playground", | |
"description": "Try and handle receiving SMS", | |
"launch_path": "/index.html", | |
"type": "certified", | |
"permissions": { | |
"sms": {}, | |
"backgroundservice": {}, | |
"desktop-notification": {} | |
}, | |
"messages": [ | |
{ "sms-received": "/index.html" }, | |
{ "notification": "/index.html" } | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment