This commit is contained in:
gorhill 2016-08-13 21:45:01 -04:00
parent 399441c837
commit fb7bd0cc1d
3 changed files with 16 additions and 7 deletions

View File

@ -231,6 +231,14 @@ var contentObserver = {
context = (context.ownerDocument || context).defaultView; context = (context.ownerDocument || context).defaultView;
} }
// https://github.com/gorhill/uBlock/issues/1893
// I don't know why this happens. I observed that when it occurred, the
// resource was not seen by the HTTP observer, as if it was a spurious
// call to shouldLoad().
if ( !context ) {
return this.ACCEPT;
}
// The context for the toolbar popup is an iframe element here, // The context for the toolbar popup is an iframe element here,
// so check context.top instead of context // so check context.top instead of context
if ( !context.top || !context.location ) { if ( !context.top || !context.location ) {

View File

@ -23,14 +23,14 @@
addMessageListener, removeMessageListener, sendAsyncMessage, outerShutdown addMessageListener, removeMessageListener, sendAsyncMessage, outerShutdown
*/ */
'use strict';
// For non background pages // For non background pages
/******************************************************************************/ /******************************************************************************/
(function(self) { (function(self) {
'use strict';
// https://github.com/chrisaljoudi/uBlock/issues/464 // https://github.com/chrisaljoudi/uBlock/issues/464
if ( document instanceof HTMLDocument === false ) { if ( document instanceof HTMLDocument === false ) {
// https://github.com/chrisaljoudi/uBlock/issues/1528 // https://github.com/chrisaljoudi/uBlock/issues/1528

View File

@ -1500,16 +1500,17 @@ vAPI.domSurveyor = (function() {
/******************************************************************************/ /******************************************************************************/
vAPI.domIsLoaded = function(ev) { vAPI.domIsLoaded = function(ev) {
// This can happen on Firefox. For instance:
// https://github.com/gorhill/uBlock/issues/1893
if ( window.location === null ) {
return;
}
if ( ev instanceof Event ) { if ( ev instanceof Event ) {
document.removeEventListener('DOMContentLoaded', vAPI.domIsLoaded); document.removeEventListener('DOMContentLoaded', vAPI.domIsLoaded);
} }
vAPI.domIsLoaded = null; vAPI.domIsLoaded = null;
// I've seen this happens on Firefox
if ( window.location === null ) {
return;
}
vAPI.executionCost.start(); vAPI.executionCost.start();
vAPI.domWatcher.start(); vAPI.domWatcher.start();