From 91dd6647322056ed3c9bb4788fe146bece6e789e Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Fri, 22 Nov 2013 11:44:43 +0100 Subject: [PATCH] [CRX] Reload extension tab after session restore --- extensions/chromium/extension-router.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/extensions/chromium/extension-router.js b/extensions/chromium/extension-router.js index 6ee6c29fb..07cac9b69 100644 --- a/extensions/chromium/extension-router.js +++ b/extensions/chromium/extension-router.js @@ -50,5 +50,16 @@ limitations under the License. CRX_BASE_URL + 'chrome-extension*' ] }, ['blocking']); + + // When session restore is used, viewer pages may be loaded before the + // webRequest event listener is attached (= page not found). + // Reload these tabs. + chrome.tabs.query({ + url: CRX_BASE_URL + '*://*' + }, function(tabsFromLastSession) { + for (var i = 0; i < tabsFromLastSession.length; ++i) { + chrome.tabs.reload(tabsFromLastSession[i].id); + } + }); console.log('Set up extension URL router.'); })();