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
};