Skip to content

Instantly share code, notes, and snippets.

@firefoxrebo
Created April 28, 2015 22:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save firefoxrebo/64934ca1adde4e9e9f74 to your computer and use it in GitHub Desktop.
Save firefoxrebo/64934ca1adde4e9e9f74 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script>
// Check if the Notification Object/Function exists
if("Notification" in window) {
Notification.requestPermission(function(status)
{
setTimeout(function()
{
var title = 'تنبيه من المتصفح';
var notify = new Notification(
title,
{
dir: 'rtl',
body: 'مرحبا بكم في التنبيهات'
}
);
notify.onclick = function()
{
// When the notification is clicked witch focus to that window
window.focus();
}
}, 5000);
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment