adding getAllCookieStores example

This commit is contained in:
chrisdavidmills
2016-08-01 13:07:41 +01:00
parent a88ad30cdf
commit d3775353d0
2 changed files with 10 additions and 2 deletions

View File

@@ -23,4 +23,12 @@ 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

@@ -64,5 +64,5 @@ reset.onclick = function() {
/* Report cookie changes to the console */
chrome.cookies.onChanged.addListener(function(changeInfo) {
console.log('Cookie changed:\n* Cookie: ' + JSON.stringify(changeInfo.cookie) + '\n* Cause: ' + changeInfo.cause + '\n* Removed: ' + changeInfo.removed)
console.log('Cookie changed:\n* Cookie: ' + JSON.stringify(changeInfo.cookie) + '\n* Cause: ' + changeInfo.cause + '\n* Removed: ' + changeInfo.removed);
})