-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathchrome.js
More file actions
33 lines (30 loc) · 952 Bytes
/
chrome.js
File metadata and controls
33 lines (30 loc) · 952 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
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
id: 'BitGoWindow',
bounds: {
width: 1000,
height: 800,
left: 100,
top: 100
},
minWidth: 1000,
minHeight: 600
});
});
chrome.runtime.onUpdateAvailable.addListener(function(details) {
console.log("updating to version " + details.version);
chrome.runtime.reload();
});
function runUpdateCheck() {
chrome.runtime.requestUpdateCheck(function(status) {
if (status == "update_available") {
console.log(new Date() + ": update pending...");
} else if (status == "no_update") {
console.log(new Date() + "no update found");
} else if (status == "throttled") {
console.log(new Date() + "Oops, I'm asking too frequently - I need to back off.");
}
});
}
runUpdateCheck(); // check on launch
setInterval(runUpdateCheck, 5 * 60 * 1000); // poll regularly to check for updates