Chrome extension cookies

Author: yifei / Created: June 12, 2017, 4:01 p.m. / Modified: June 12, 2017, 4:22 p.m. / Edit


set the cookies permission and the domain you would like to access cookies.

"permissions": {


just a simple object with {name, value, domain...}


normal mode and incognito mode use different cookie stores.


get: chrome.cookies.get({url: URL, name: COOKIE_NAME, storeId: COOKIE_STORE_ID}, function(cookie) {})

get all: chrome.cookies.get({domain: DOMAIN}, function(cookies) {}) NOTE: there are other filters not listed here.

set: chrome.cookies.set({url, name, value}, function(cookie) {}) if failed, the callback gets null

有任何问题可以发邮件到 kongyifei (at) 讨论