From 49634fb68581b1a6851a3134cf2e21d59e36a852 Mon Sep 17 00:00:00 2001 From: chrisdavidmills Date: Mon, 1 Aug 2016 13:11:04 +0100 Subject: [PATCH] moving getCookieStores() example to somewhere where it might be a little more effective --- cookie-bg-picker/background_scripts/background.js | 10 +--------- cookie-bg-picker/popup/bgpicker.js | 8 ++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cookie-bg-picker/background_scripts/background.js b/cookie-bg-picker/background_scripts/background.js index a7585ae..8a728ab 100644 --- a/cookie-bg-picker/background_scripts/background.js +++ b/cookie-bg-picker/background_scripts/background.js @@ -23,12 +23,4 @@ function cookieUpdate(tabId, changeInfo, tab) { } }); }); -} - -/* Retrieve information on the browser's cookies stores */ - -browser.cookies.getAllCookieStores(function(cookieStores) { - for(var i = 0; i < cookieStores.length; i++) { - console.log('Cookie store: ' + cookieStores[i].id + '\n Tab IDs: ' + cookieStores[i].tabIds); - } -}) \ No newline at end of file +} \ No newline at end of file diff --git a/cookie-bg-picker/popup/bgpicker.js b/cookie-bg-picker/popup/bgpicker.js index af9699f..00b69b0 100644 --- a/cookie-bg-picker/popup/bgpicker.js +++ b/cookie-bg-picker/popup/bgpicker.js @@ -65,4 +65,12 @@ reset.onclick = function() { chrome.cookies.onChanged.addListener(function(changeInfo) { console.log('Cookie changed:\n* Cookie: ' + JSON.stringify(changeInfo.cookie) + '\n* Cause: ' + changeInfo.cause + '\n* Removed: ' + changeInfo.removed); +}) + +/* Retrieve information on the browser's cookie stores */ + +browser.cookies.getAllCookieStores(function(cookieStores) { + for(var i = 0; i < cookieStores.length; i++) { + console.log('Cookie store: ' + cookieStores[i].id + '\n Tab IDs: ' + cookieStores[i].tabIds); + } }) \ No newline at end of file