WebKit.CookieManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when cookies are added, removed or modified. |
Fields¶
- Inherited:
Class Details¶
- class WebKit.CookieManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Defines how to handle cookies in a
WebKit.WebContext
.The
WebKit.CookieManager
defines how to set up and handle cookies. You can get it from aWebKit.WebsiteDataManager
with webkit_website_data_manager_get_cookie_manager(), and use it to set where to store cookies withWebKit.CookieManager.set_persistent_storage
(), or to set the acceptance policy, withWebKit.CookieManager.get_accept_policy
().- add_cookie(cookie, cancellable, callback, *user_data)¶
- Parameters:
cookie (
Soup.Cookie
) – theSoup.Cookie
to be addedcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
to ignorecallback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
Asynchronously add a
Soup.Cookie
to the underlying storage.When the operation is finished, callback will be called. You can then call
WebKit.CookieManager.add_cookie_finish
() to get the result of the operation.New in version 2.20.
- add_cookie_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
- Return type:
Finish an asynchronous operation started with
WebKit.CookieManager.add_cookie
().New in version 2.20.
- delete_cookie(cookie, cancellable, callback, *user_data)¶
- Parameters:
cookie (
Soup.Cookie
) – theSoup.Cookie
to be deletedcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
to ignorecallback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
Asynchronously delete a
Soup.Cookie
from the current session.When the operation is finished, callback will be called. You can then call
WebKit.CookieManager.delete_cookie_finish
() to get the result of the operation.New in version 2.20.
- delete_cookie_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
- Return type:
Finish an asynchronous operation started with
WebKit.CookieManager.delete_cookie
().New in version 2.20.
- get_accept_policy(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
to ignorecallback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
Asynchronously get the cookie acceptance policy of self.
Note that when policy was set to
WebKit.CookieAcceptPolicy.NO_THIRD_PARTY
and ITP is enabled, this will returnWebKit.CookieAcceptPolicy.ALWAYS
. See also webkit_website_data_manager_set_itp_enabled().When the operation is finished, callback will be called. You can then call
WebKit.CookieManager.get_accept_policy_finish
() to get the result of the operation.
- get_accept_policy_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
the cookie acceptance policy of self as a
WebKit.CookieAcceptPolicy
.- Return type:
Finish an asynchronous operation started with
WebKit.CookieManager.get_accept_policy
().
- get_all_cookies(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
to ignorecallback (
Gio.AsyncReadyCallback
orNone
) – (closure user_data): aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
Asynchronously get a list of
Soup.Cookie
from self.When the operation is finished, callback will be called. You can then call
WebKit.CookieManager.get_all_cookies_finish
() to get the result of the operation.New in version 2.42.
- get_all_cookies_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
A
GLib.List
ofSoup.Cookie
instances.- Return type:
Finish an asynchronous operation started with
WebKit.CookieManager.get_all_cookies
().The return value is a
GLib.List
ofSoup.Cookie
instances which should be released with g_list_free_full() andSoup.Cookie.free
().New in version 2.42.
- get_cookies(uri, cancellable, callback, *user_data)¶
- Parameters:
uri (
str
) – the URI associated to the cookies to be retrievedcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
to ignorecallback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
Asynchronously get a list of
Soup.Cookie
from self.Asynchronously get a list of
Soup.Cookie
from self associated with uri, which must be either an HTTP or an HTTPS URL.When the operation is finished, callback will be called. You can then call
WebKit.CookieManager.get_cookies_finish
() to get the result of the operation.New in version 2.20.
- get_cookies_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
A
GLib.List
ofSoup.Cookie
instances.- Return type:
Finish an asynchronous operation started with
WebKit.CookieManager.get_cookies
().The return value is a
GLib.List
ofSoup.Cookie
instances which should be released with g_list_free_full() andSoup.Cookie.free
().New in version 2.20.
- replace_cookies(cookies, cancellable, callback, *user_data)¶
- Parameters:
cookies ([
Soup.Cookie
]) – aGLib.List
ofSoup.Cookie
to be addedcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
to ignorecallback (
Gio.AsyncReadyCallback
orNone
) – (closure user_data): aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
Asynchronously replace all cookies in self with the given list of cookies.
When the operation is finished, callback will be called. You can then call
WebKit.CookieManager.replace_cookies_finish
() to get the result of the operation.New in version 2.42.
- replace_cookies_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
- Return type:
Finish an asynchronous operation started with
WebKit.CookieManager.replace_cookies
().New in version 2.42.
- set_accept_policy(policy)¶
- Parameters:
policy (
WebKit.CookieAcceptPolicy
) – aWebKit.CookieAcceptPolicy
Set the cookie acceptance policy of self as policy.
Note that ITP has its own way to handle third-party cookies, so when it’s enabled, and policy is set to
WebKit.CookieAcceptPolicy.NO_THIRD_PARTY
,WebKit.CookieAcceptPolicy.ALWAYS
will be used instead. Once disabled, the policy will be set back toWebKit.CookieAcceptPolicy.NO_THIRD_PARTY
. See also webkit_website_data_manager_set_itp_enabled().
- set_persistent_storage(filename, storage)¶
- Parameters:
filename (
str
) – the filename to read to/write fromstorage (
WebKit.CookiePersistentStorage
) – aWebKit.CookiePersistentStorage
Set non-session cookies.
Set the filename where non-session cookies are stored persistently using storage as the format to read/write the cookies. Cookies are initially read from filename to create an initial set of cookies. Then, non-session cookies will be written to filename when the
WebKit.CookieManager
::changed
signal is emitted. By default, self doesn’t store the cookies persistently, so you need to call this method to keep cookies saved across sessions.This method should never be called on a
WebKit.CookieManager
associated to an ephemeralWebKit.WebsiteDataManager
.
Signal Details¶
- WebKit.CookieManager.signals.changed(cookie_manager)¶
- Signal Name:
changed
- Flags:
- Parameters:
cookie_manager (
WebKit.CookieManager
) – The object which received the signal
This signal is emitted when cookies are added, removed or modified.