Browse Source

this should fix #225

pull/2/head
gorhill 10 years ago
parent
commit
b20d44e36c
  1. 5
      src/js/messaging.js
  2. 7
      src/js/tab.js

5
src/js/messaging.js

@ -413,6 +413,11 @@ var contentScriptSummaryHandler = function(tabId, details) {
var url = frameURL + '{inline_script}';
pageStore.recordRequest('script', url, 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);
};
/******************************************************************************/

7
src/js/tab.js

@ -657,9 +657,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) {

Loading…
Cancel
Save