cookies
Позволяет WebExtensions получить и установить куки ,а также сообщить об их изменении.
Для использования этого 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
Browser compatibility
BCD tables only load in the browser
Edge incompatibilities
Promises are not supported in Edge. Use callbacks instead.
Example extensions
Примечание: Это API основано на API Chromium chrome.cookies
. Эта документация основана на cookies.json
из кода Chromium.
Информация о совместимости Microsoft Edge предоставлена корпорацией Microsoft и включена здесь под лицензией Creative Commons Attribution 3.0 United States License.