[CRX] Reload extension tab after session restore

This commit is contained in:
Rob Wu 2013-11-22 11:44:43 +01:00
parent 5ecb407ca7
commit 91dd664732

View File

@ -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.');
})();