mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
Merge pull request #3952 from Rob--W/crx/load-after-session-restore
[CRX] Reload extension tab after session restore
This commit is contained in:
commit
6c92ee0375
1 changed files with 11 additions and 0 deletions
|
@ -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.');
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue