cookies
Позволяет расширениям получать и устанавливать куки, а также сообщать об их изменении.
Для использования этого API,вам нужно предоставить доступ API permission в вашем файле manifest.json,а также host permissions для тех сайтов чьи куки вам нужны для доступа.Смотрите cookie Permissions.
Types
-
Предоставляет информацию о HTTP cookie
-
Represents a cookie store in the browser.
-
Represents the reason a cookie changed.
Methods
-
Запрашивает информацию об одном кукис.
-
Выдаёт все кукис которые подходят установленному фильтру.
-
Устанавливает кукис с заданной информацией;в том случае если подобный кукис был информация будет перезаписана.
-
Удаляет кукис по имени.
-
Список всех существующих куки
Event handlers
-
Происходит когда кукис задаётся или меняется.
Permissions
In order to use this API, an add-on must specify the "cookies" API permission in its manifest, along with host permissions for any sites for which it wishes to access cookies. The add-on may read or write any cookies which could be read or written by a URL matching the host permissions. For example:
http://*.example.com/
-
An add-on with this host permission may:
- Read a non-secure cookie for
www.example.com
, with any path. - Write a secure or non-secure cookie for
www.example.com
, with any path.
It may not:
- Read a secure cookie for
www.example.com
.
- Read a non-secure cookie for
http://www.example.com/
-
An add-on with this host permission may:
- Read a non-secure cookie for
www.example.com
, with any path. - Read a non-secure cookie for
.example.com
, with any path. - Write a secure or non-secure cookie for
www.example.com
with any path. - Write a secure or non-secure cookie for
.example.com
with any path.
It may not:
- Read or write a cookie for
foo.example.com
. - Read or write a cookie for
foo.www.example.com
.
- Read a non-secure cookie for
*://*.example.com/
-
An add-on with this host permission may:
- Read or write a secure or non-secure cookie for
www.example.com
with any path.
- Read or write a secure or non-secure cookie for
Совместимость с браузерами
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
Cookie | |||||||
Cookie.firstPartyDomain | |||||||
Cookie.partitionKey | |||||||
Cookie.sameSite | |||||||
CookieStore | |||||||
CookieStore.id | |||||||
CookieStore.incognito | |||||||
CookieStore.tabIds | |||||||
OnChangedCause | |||||||
get | |||||||
get.firstPartyDomain | |||||||
get.partitionKey | |||||||
getAll | |||||||
getAll.firstPartyDomain | |||||||
getAll.partitionKey | |||||||
getAllCookieStores | |||||||
onChanged | |||||||
onChanged.partitionKey | |||||||
remove | |||||||
remove.firstPartyDomain | |||||||
remove.partitionKey | |||||||
sameSiteStatus | |||||||
sameSiteStatus.lax | |||||||
sameSiteStatus.no_restriction | |||||||
sameSiteStatus.strict | |||||||
sameSiteStatus.unspecified | |||||||
set | |||||||
set.firstPartyDomain | |||||||
set.partitionKey | |||||||
set.sameSite |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- No support
- No support
- See implementation notes.
- Has more compatibility info.
Example extensions
Примечание:
Этот API основан на Chromium API chrome.cookies
. Эта документация основана на cookies.json
из кода Chromium.