forked from lambdaspace/ConsuelaAddOn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMinisterIn.js
More file actions
41 lines (36 loc) · 874 Bytes
/
Copy pathMinisterIn.js
File metadata and controls
41 lines (36 loc) · 874 Bytes
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
var isOpen = false;
function updateIcon() {
chrome.browserAction.setIcon({
path: isOpen ? {
48: "icons/o_48x48.png",
96: "icons/o_96x96.png"
} : {
48: "icons/c_48x48.png",
96: "icons/c_96x96.png"
}
});
}
function checkStatus(text){
num = parseInt(text);
if (num > 0) {
isOpen = true;
}else {
isOpen = false;
}
updateIcon();
}
function httpGetAsync(theUrl, callback)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
callback(xmlHttp.responseText);
};
xmlHttp.open("GET", theUrl, true); // true for asynchronous
xmlHttp.send(null);
}
function timer(){
httpGetAsync("https://www.techministry.gr/hackers.txt", checkStatus);
}
httpGetAsync("https://www.techministry.gr/hackers.txt", checkStatus);
setInterval(timer, 300000);