Skip to content

Commit

Permalink
block sending cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
xi committed May 18, 2023
1 parent 9273f87 commit d06aa98
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ browser.webRequest.onBeforeSendHeaders.addListener(details => {
return {cancel: true};
}
}

if (shared.shouldAllow(rules, context, hostname, 'cookie')) {
return {requestHeaders: details.requestHeaders};
} else {
var filtered = details.requestHeaders.filter(h => !isCookie(h));
return {requestHeaders: filtered};
}
});
}, {urls: ['<all_urls>']}, ['blocking', 'requestHeaders']);

Expand Down

0 comments on commit d06aa98

Please sign in to comment.