Created
April 28, 2015 22:25
-
-
Save firefoxrebo/64934ca1adde4e9e9f74 to your computer and use it in GitHub Desktop.
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 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