1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 04:49:12 +02:00
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;
}
// 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,
// so check context.top instead of context
if ( !context.top || !context.location ) {

View File

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

View File

@ -1500,16 +1500,17 @@ vAPI.domSurveyor = (function() {
/******************************************************************************/
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 ) {
document.removeEventListener('DOMContentLoaded', vAPI.domIsLoaded);
}
vAPI.domIsLoaded = null;
// I've seen this happens on Firefox
if ( window.location === null ) {
return;
}
vAPI.executionCost.start();
vAPI.domWatcher.start();