very slightly more reliable page title lookup

This commit is contained in:
gorhill 2015-05-26 17:16:16 -04:00
parent 2c3d810840
commit 812d34bfe8
1 changed files with 6 additions and 1 deletions

View File

@ -619,9 +619,14 @@ vAPI.tabs.registerListeners();
if ( !tab.title && tryAgain(tabId) ) {
return;
}
tryNoMore(tabId);
// https://github.com/gorhill/uMatrix/issues/225
// Sometimes title changes while page is loading.
var settled = tab.title && tab.title === pageStore.title;
pageStore.title = tab.title || tab.url || '';
this.pageStoresToken = Date.now();
if ( settled || !tryAgain(tabId) ) {
tryNoMore(tabId);
}
};
var updateTitle = function(tabId) {