1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-26 18:10:39 +12:00

this should fix #225

This commit is contained in:
gorhill 2015-05-27 07:51:48 -04:00
parent dd657f31ae
commit b20d44e36c
2 changed files with 11 additions and 1 deletions

View file

@ -413,6 +413,11 @@ var contentScriptSummaryHandler = function(tabId, details) {
var url = frameURL + '{inline_script}'; var url = frameURL + '{inline_script}';
pageStore.recordRequest('script', url, inlineScriptBlocked); pageStore.recordRequest('script', url, inlineScriptBlocked);
µm.logger.writeOne(tabId, 'net', pageHostname, url, 'script', inlineScriptBlocked); µm.logger.writeOne(tabId, 'net', pageHostname, url, 'script', inlineScriptBlocked);
// https://github.com/gorhill/uMatrix/issues/225
// A good place to force an update of the page title, as at this point
// the DOM has been loaded.
µm.updateTitle(tabId);
}; };
/******************************************************************************/ /******************************************************************************/

View file

@ -657,9 +657,14 @@ vAPI.tabs.registerListeners();
if ( !tab.title && tryAgain(tabId) ) { if ( !tab.title && tryAgain(tabId) ) {
return; 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 || ''; pageStore.title = tab.title || tab.url || '';
this.pageStoresToken = Date.now(); this.pageStoresToken = Date.now();
if ( settled || !tryAgain(tabId) ) {
tryNoMore(tabId);
}
}; };
var updateTitle = function(tabId) { var updateTitle = function(tabId) {