Skip to content

Commit 83a9f3c

Browse files
committed
no need for onHeadersReceived(), onCookieChanged() does the job well
1 parent 892ad0f commit 83a9f3c

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

js/traffic.js

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -281,34 +281,6 @@ function beforeSendHeadersHandler(details) {
281281

282282
/******************************************************************************/
283283

284-
// This is to handle cookies arriving in the browser.
285-
286-
function headersReceivedHandler(details) {
287-
288-
// Ignore traffic outside tabs
289-
var tabId = details.tabId;
290-
if ( tabId < 0 || tabId === HTTPSB.behindTheSceneTabId ) {
291-
return;
292-
}
293-
294-
var pageStats = pageStatsFromTabId(tabId);
295-
if ( !pageStats ) {
296-
return;
297-
}
298-
299-
// Any `set-cookie` directive in there?
300-
var headers = details.responseHeaders;
301-
var i = headers.length;
302-
while ( i-- ) {
303-
if ( headers[i].name.toLowerCase() === 'set-cookie' ) {
304-
cookieHunter.record(pageStats);
305-
break;
306-
}
307-
}
308-
}
309-
310-
/******************************************************************************/
311-
312284
var webRequestHandlerRequirements = {
313285
'tabsBound': 0,
314286
'listsLoaded': 0
@@ -356,17 +328,4 @@ function startWebRequestHandler(from) {
356328
},
357329
['blocking', 'requestHeaders']
358330
);
359-
360-
chrome.webRequest.onHeadersReceived.addListener(
361-
headersReceivedHandler,
362-
{
363-
'urls': [
364-
"http://*/*",
365-
"https://*/*"
366-
]
367-
},
368-
['responseHeaders']
369-
);
370-
371-
HTTPSB.webRequestHandler = true;
372331
}

0 commit comments

Comments
 (0)