mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
fix #1893
This commit is contained in:
parent
399441c837
commit
fb7bd0cc1d
3 changed files with 16 additions and 7 deletions
|
@ -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 ) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue