diff --git a/js/cookies.js b/js/cookies.js index 99c9ab7..71cf6b4 100644 --- a/js/cookies.js +++ b/js/cookies.js @@ -91,11 +91,6 @@ function findAndRecordCookies(pageUrl) { if ( block ) { addStateFromPageStats(pageStats, 'cookie', domain); } - chrome.contentSettings.cookies.set({ - primaryPattern: '*://' + domain + '/*', - secondaryPattern: '', - setting: block ? 'block' : 'allow' - }); // console.debug('HTTP Switchboard > findAndRecordCookies: "%s" (cookie=%O)', cookieUrl, cookie); } }); @@ -180,11 +175,6 @@ chrome.cookies.onChanged.addListener(function(changeInfo) { if ( block ) { addStateFromPageStats(pageStats, 'cookie', domain); } - chrome.contentSettings.cookies.set({ - primaryPattern: '*://' + domain + '/*', - secondaryPattern: '', - setting: block ? 'block' : 'allow' - }); // console.debug('HTTP Switchboard > chrome.cookies.onChanged: "%s" (cookie=%O)', cookieUrl, cookie); } }); diff --git a/js/start.js b/js/start.js index 7bc3b4e..dcf2e1d 100644 --- a/js/start.js +++ b/js/start.js @@ -23,6 +23,15 @@ /******************************************************************************/ +// rhill 20131017 > https://github.com/gorhill/httpswitchboard/issues/9: +// HTTP Switchboard relinquishes all control of cookies settings (it will +// however keep removing outbound cookies from headers, so this is equivalent +// to a recording machine which can never be played back). + +chrome.contentSettings.cookies.clear({}); + +/******************************************************************************/ + chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { // Can this happen? if ( !tab.url || !tab.url.length ) { diff --git a/js/traffic.js b/js/traffic.js index 099a2f5..17ca397 100644 --- a/js/traffic.js +++ b/js/traffic.js @@ -108,6 +108,7 @@ function webRequestHandler(details) { // Ignore stylesheet requests if ( type === 'stylesheet' ) { + // console.log("HTTPSB > %s @ url=%s", details.type, details.url); return; } @@ -144,11 +145,6 @@ function webRequestHandler(details) { primaryPattern: '*://' + domain + '/*', setting: blacklisted('object', domain) ? 'block' : 'allow' }); - chrome.contentSettings.cookies.set({ - primaryPattern: '*://' + domain + '/*', - secondaryPattern: '', - setting: blacklisted('cookie', domain) ? 'block' : 'allow' - }); // when the tab is updated, we will check if page has at least one // script tag, this takes care of inline scripting, which doesn't @@ -163,6 +159,7 @@ function webRequestHandler(details) { HTTPSB.allowedRequestCounters.all += 1; HTTPSB.allowedRequestCounters[type] += 1; + // console.log("HTTPSB > %s @ url=%s", details.type, details.url); return; } @@ -204,9 +201,7 @@ function webRequestHandler(details) { function webHeaderRequestHandler(details) { - // ignore traffic outside tabs - // TODO: when might this happen? - // Apparently from within extensions + // Ignore traffic outside tabs if ( details.tabId < 0 ) { return; } @@ -237,6 +232,9 @@ function webHeaderRequestHandler(details) { // console.debug('HTTP Switchboard > foiled attempt to send %d cookies "%s..." to %s', cookieCount, cookieValue.slice(0,40), details.url); headers.splice(i, 1); } +// else { +// console.log('HTTPSB > %d cookies @ %s', cookieCount, details.url); +// } } if ( blacklistCookie ) {