diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 147ed66fb..8556355b7 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -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) { diff --git a/src/js/traffic.js b/src/js/traffic.js index 6a01e9591..1c98f76c6 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -414,16 +414,6 @@ vAPI.net.onBeforeRequest = { 'http://*/*', 'https://*/*' ], - types: [ - "main_frame", - "sub_frame", - 'stylesheet', - "script", - "image", - "object", - "xmlhttprequest", - "other" - ], extra: [ 'blocking' ], callback: onBeforeRequest };