Skip to content

Instantly share code, notes, and snippets.

@colinfrei
Created June 14, 2014 13:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colinfrei/48476f365ee8f451534c to your computer and use it in GitHub Desktop.
Save colinfrei/48476f365ee8f451534c to your computer and use it in GitHub Desktop.
SMS Notifier
<!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>
{
"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