mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02: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 onBeforeRequest = vAPI.net.onBeforeRequest;
|
||||||
var type = this.typeMap[details.type] || 'other';
|
var type = this.typeMap[details.type] || 'other';
|
||||||
|
|
||||||
if ( onBeforeRequest.types.has(type) === false ) {
|
if ( onBeforeRequest.types && onBeforeRequest.types.has(type) === false ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1270,7 +1270,9 @@ vAPI.net.registerListeners = function() {
|
|||||||
// Since it's not used
|
// Since it's not used
|
||||||
this.onBeforeSendHeaders = null;
|
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 shouldLoadListenerMessageName = location.host + ':shouldLoad';
|
||||||
var shouldLoadListener = function(e) {
|
var shouldLoadListener = function(e) {
|
||||||
|
@ -414,16 +414,6 @@ vAPI.net.onBeforeRequest = {
|
|||||||
'http://*/*',
|
'http://*/*',
|
||||||
'https://*/*'
|
'https://*/*'
|
||||||
],
|
],
|
||||||
types: [
|
|
||||||
"main_frame",
|
|
||||||
"sub_frame",
|
|
||||||
'stylesheet',
|
|
||||||
"script",
|
|
||||||
"image",
|
|
||||||
"object",
|
|
||||||
"xmlhttprequest",
|
|
||||||
"other"
|
|
||||||
],
|
|
||||||
extra: [ 'blocking' ],
|
extra: [ 'blocking' ],
|
||||||
callback: onBeforeRequest
|
callback: onBeforeRequest
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user