From 0ac323961b01fb0de7b984cc8ae08f538e4651cd Mon Sep 17 00:00:00 2001 From: lilia Date: Thu, 12 Mar 2015 11:23:41 -0700 Subject: [PATCH] Close the inbox if the background page is refreshed --- js/panel_controller.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/panel_controller.js b/js/panel_controller.js index 6ba52147..79bcd117 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -94,6 +94,12 @@ height: 440 // 420 for chat }, function (windowInfo) { inboxWindowId = windowInfo.id; + + // close the panel if background.html is refreshed + window.addEventListener('beforeunload', function () { + // TODO: reattach after reload instead of closing. + extension.windows.remove(windowInfo.id); + }); }); } else if (inboxOpened === true) { extension.windows.focus(inboxWindowId);