1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-26 04:12:50 +01:00
This commit is contained in:
gorhill 2015-05-09 01:16:27 -04:00
parent ce6eb9b7ac
commit ba8dd756c9
2 changed files with 4 additions and 12 deletions

View File

@ -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) {

View File

@ -414,16 +414,6 @@ vAPI.net.onBeforeRequest = {
'http://*/*',
'https://*/*'
],
types: [
"main_frame",
"sub_frame",
'stylesheet',
"script",
"image",
"object",
"xmlhttprequest",
"other"
],
extra: [ 'blocking' ],
callback: onBeforeRequest
};