-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.html
48 lines (38 loc) · 898 Bytes
/
popup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<script>
var obj;
function ajax_request()
{
//alert("asd");
obj=new XMLHttpRequest();
obj.open('get','http://m.goal.com/en-us/scores/live',true);
obj.onreadystatechange = ajax_fetch;
obj.send(null);
}
function ajax_fetch()
{
if (obj.readyState == 4)
{
document.getElementById('content').innerHTML=obj.responseText;
}
}
function getPermission(callback)
{
windows.webkitNotifications.requestPermission(callback);
}
function notification()
{
if (window.webkitNotifications.checkPermission() > 0)
getPermission(notification);
var icon="img/icon48.png";
var title="title";
var desc="description";
var popup= window.webkitNotifications.createNotification(icon,title,desc);
popup.show();
setTileout( function() {
popup.cancle();},'5000');
}
notification();
</script>
<body onload='ajax_request()'>
Here is the Content:
<div id="content">I am content</div>