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.CookieManagerdefines how to set up and handle cookies. You can get it from aWebKit.WebsiteDataManagerwith 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.Cookieto be addedcancellable (
Gio.CancellableorNone) – aGio.CancellableorNoneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – the data to pass to callback function
Asynchronously add a
Soup.Cookieto 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.Cookieto be deletedcancellable (
Gio.CancellableorNone) – aGio.CancellableorNoneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – the data to pass to callback function
Asynchronously delete a
Soup.Cookiefrom 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.CancellableorNone) – aGio.CancellableorNoneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – 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_PARTYand 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.CancellableorNone) – aGio.CancellableorNoneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – (closure user_data): aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – the data to pass to callback function
Asynchronously get a list of
Soup.Cookiefrom 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.ListofSoup.Cookieinstances.- Return type:
Finish an asynchronous operation started with
WebKit.CookieManager.get_all_cookies().The return value is a
GLib.ListofSoup.Cookieinstances 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.CancellableorNone) – aGio.CancellableorNoneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – the data to pass to callback function
Asynchronously get a list of
Soup.Cookiefrom self.Asynchronously get a list of
Soup.Cookiefrom 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.ListofSoup.Cookieinstances.- Return type:
Finish an asynchronous operation started with
WebKit.CookieManager.get_cookies().The return value is a
GLib.ListofSoup.Cookieinstances 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.ListofSoup.Cookieto be addedcancellable (
Gio.CancellableorNone) – aGio.CancellableorNoneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – (closure user_data): aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – 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.ALWAYSwill 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::changedsignal 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.CookieManagerassociated 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.