mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-26 04:12:50 +01:00
this fixes #185
This commit is contained in:
parent
ce6eb9b7ac
commit
ba8dd756c9
@ -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 New Issue
Block a user