Chrome extension cookies

permissions

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

"permissions": {
    "cookies",
    "*://*.example.com/"
}

type

cookie

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

CookieStore

normal mode and incognito mode use different cookie stores.

read

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

及时获取更新,请关注公众号“爬虫技术学习(spider-learn)”

公众号“爬虫技术学习(spider-learn)”

About 逸飞

后端工程师

发表评论

电子邮件地址不会被公开。 必填项已用*标注