mirror of https://github.com/gorhill/uBlock.git
fix #1893
This commit is contained in:
parent
399441c837
commit
fb7bd0cc1d
|
@ -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 ) {
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue