moving getCookieStores() example to somewhere where it might be a little more effective

This commit is contained in:
chrisdavidmills
2016-08-01 13:11:04 +01:00
parent d3775353d0
commit 49634fb685
2 changed files with 9 additions and 9 deletions

View File

@@ -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);
}
})
}

View File

@@ -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);
}
})