mirror of
https://github.com/moparisthebest/mail
synced 2024-12-23 15:58:49 -05:00
Check for updates on every start of teh chrome app and restart automatically.
This commit is contained in:
parent
7cbc185d93
commit
cc2dc0d455
@ -1,5 +1,21 @@
|
|||||||
'use strict';
|
'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.runtime.onLaunched.addListener(function() {
|
||||||
chrome.app.window.create('chrome.html', {
|
chrome.app.window.create('chrome.html', {
|
||||||
'bounds': {
|
'bounds': {
|
||||||
|
Loading…
Reference in New Issue
Block a user