Skip to content

Commit

Permalink
this fixes #185
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed May 9, 2015
1 parent ce6eb9b commit ba8dd75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
6 changes: 4 additions & 2 deletions platform/firefox/vapi-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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) {
Expand Down
10 changes: 0 additions & 10 deletions src/js/traffic.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,6 @@ vAPI.net.onBeforeRequest = {
'http://*/*',
'https://*/*'
],
types: [
"main_frame",
"sub_frame",
'stylesheet',
"script",
"image",
"object",
"xmlhttprequest",
"other"
],
extra: [ 'blocking' ],
callback: onBeforeRequest
};
Expand Down

0 comments on commit ba8dd75

Please sign in to comment.