mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
this fixes #185
This commit is contained in:
parent
ce6eb9b7ac
commit
ba8dd756c9
2 changed files with 4 additions and 12 deletions
|
@ -1071,7 +1071,7 @@ var httpObserver = {
|
|||
var onBeforeRequest = vAPI.net.onBeforeRequest;
|
||||
var type = this.typeMap[details.type] || 'other';
|
||||
|
||||
if ( onBeforeRequest.types.has(type) === false ) {
|
||||
if ( onBeforeRequest.types && onBeforeRequest.types.has(type) === false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1270,7 +1270,9 @@ vAPI.net.registerListeners = function() {
|
|||
// Since it's not used
|
||||
this.onBeforeSendHeaders = null;
|
||||
|
||||
this.onBeforeRequest.types = new Set(this.onBeforeRequest.types);
|
||||
this.onBeforeRequest.types = this.onBeforeRequest.types ?
|
||||
new Set(this.onBeforeRequest.types) :
|
||||
null;
|
||||
|
||||
var shouldLoadListenerMessageName = location.host + ':shouldLoad';
|
||||
var shouldLoadListener = function(e) {
|
||||
|
|
|
@ -414,16 +414,6 @@ vAPI.net.onBeforeRequest = {
|
|||
'http://*/*',
|
||||
'https://*/*'
|
||||
],
|
||||
types: [
|
||||
"main_frame",
|
||||
"sub_frame",
|
||||
'stylesheet',
|
||||
"script",
|
||||
"image",
|
||||
"object",
|
||||
"xmlhttprequest",
|
||||
"other"
|
||||
],
|
||||
extra: [ 'blocking' ],
|
||||
callback: onBeforeRequest
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue