-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
30 lines (24 loc) · 736 Bytes
/
background.js
File metadata and controls
30 lines (24 loc) · 736 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
function check_url(url, callback) {
const Http = new XMLHttpRequest();
Http.open('GET', url);
Http.send();
Http.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {
console.log('Status is good');
}
callback && callback(url, this.status);
}
}
}
chrome.runtime.onInstalled.addListener(function() {
console.info('calling in onInstalled');
chrome.storage.local.get(['sites'], function(result) {
console.log('Value currently is ' + result.key);
});
});
setInterval(function() {
check_url('https://translation.infraworks360.autodesk.com/health', function(url, status) {
console.log('Checking ' + url + ' returns ' + status);
});
}, 2000);