From 8a2642a51c163fdf45c0fe5236efae51a5b68b81 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 31 May 2017 22:55:03 +0200 Subject: version, apply updates ASAP --- src/webex/wxBackend.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/webex/wxBackend.ts b/src/webex/wxBackend.ts index 356b2af6e..5290b4c17 100644 --- a/src/webex/wxBackend.ts +++ b/src/webex/wxBackend.ts @@ -428,6 +428,13 @@ function clearRateLimitCache() { * Sets up all event handlers and other machinery. */ export async function wxMain() { + // Explicitly unload the extension page as soon as an update is available, + // so the update gets installed as soon as possible. + chrome.runtime.onUpdateAvailable.addListener((details) => { + console.log("update available:", details); + chrome.runtime.reload(); + }) + window.onerror = (m, source, lineno, colno, error) => { logging.record("error", m + error, undefined, source || "(unknown)", lineno || 0, colno || 0); }; -- cgit v1.2.3