1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-23 07:48:48 -05:00

Check for updates on every start of teh chrome app and restart automatically.

This commit is contained in:
Tankred Hase 2013-11-08 16:04:52 +01:00
parent 7cbc185d93
commit cc2dc0d455

View File

@ -1,5 +1,21 @@
'use strict';
// check for update and restart app automatically
chrome.runtime.onUpdateAvailable.addListener(function(details) {
console.log("Updating to version " + details.version);
chrome.runtime.reload();
});
chrome.runtime.requestUpdateCheck(function(status) {
if (status === "update_found") {
console.log("Update pending...");
} else if (status === "no_update") {
console.log("No update found.");
} else if (status === "throttled") {
console.log("Checking updates too frequently.");
}
});
// open chrome app in new window
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('chrome.html', {
'bounds': {