Skip to content

Commit

Permalink
Update listener comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostwords committed Sep 17, 2018
1 parent 899b632 commit c40bf55
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/js/heuristicblocking.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ function pingListener(details) {
}

function startListeners() {
// listen to pings
try {
chrome.webRequest.onBeforeRequest.addListener(
pingListener, { types: ["beacon", "ping"], urls: ["<all_urls>"] });
Expand All @@ -552,16 +553,12 @@ function startListeners() {
pingListener, { types: ["ping"], urls: ["<all_urls>"] });
}

/**
* Adds heuristicBlockingAccounting as listened to onBeforeSendHeaders request
*/
// inspect cookies in outgoing headers
chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
return badger.heuristicBlocking.heuristicBlockingAccounting(details);
}, {urls: ["<all_urls>"]}, ["requestHeaders"]);

/**
* Adds onResponseStarted listener. Monitor for cookies
*/
// inspect cookies in incoming headers
chrome.webRequest.onResponseStarted.addListener(function(details) {
var hasSetCookie = false;
for (var i = 0; i < details.responseHeaders.length; i++) {
Expand Down

0 comments on commit c40bf55

Please sign in to comment.