WebKit2.WebsiteDataManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
|||
r/w/co |
|||
d/r/w/co |
|
||
d/r/w/co |
|
||
d/r/w/co |
|
||
d/r/w/co |
|
||
r/w/co |
|||
d/r/w/co |
|
||
d/r/w/co |
|
||
d/r/w/co |
|
||
w/co |
|||
d/r/w/co |
|
||
w/co |
|||
d/r/w/co |
|
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class WebKit2.WebsiteDataManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Manages data stored locally by web sites.
You can use
WebKit2.WebsiteDataManagerto configure the local directories where website data will be stored. UseWebKit2.WebsiteDataManager:base-data-directoryandWebKit2.WebsiteDataManager:base-cache-directoryset a common base directory for all website data and caches.A
WebKit2.WebsiteDataManagercan be ephemeral, in which case all the directory configuration is not needed because website data will never persist. You can create an ephemeralWebKit2.WebsiteDataManagerwithWebKit2.WebsiteDataManager.new_ephemeral().WebKit2.WebsiteDataManagercan also be used to fetch website data, remove data stored by particular websites, or clear data for all websites modified since a given period of time.New in version 2.10.
- classmethod new_ephemeral()¶
- Returns:
a new ephemeral
WebKit2.WebsiteDataManager.- Return type:
Creates an ephemeral
WebKit2.WebsiteDataManager.See
WebKit2.WebsiteDataManager:is-ephemeralfor more details.New in version 2.16.
- classmethod set_memory_pressure_settings(settings)¶
- Parameters:
settings (
WebKit2.MemoryPressureSettings) – aWebKit2.MemoryPressureSettings.
Sets settings as the
WebKit2.MemoryPressureSettings.Sets settings as the
WebKit2.MemoryPressureSettingsto be used by all the network processes created by any instance ofWebKit2.WebsiteDataManagerafter this function is called.Be sure to call this function before creating any
WebKit2.WebsiteDataManager, as network processes of existing instances are not guaranteed to receive the passed settings.The periodic check for used memory is disabled by default on network processes. This will be enabled only if custom settings have been set using this function. After that, in order to remove the custom settings and disable the periodic check, this function must be called passing
Noneas the value of settings.New in version 2.34.
- clear(types, timespan, cancellable, callback, *user_data)¶
- Parameters:
timespan (
int) – a #GTimeSpancancellable (
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 clear the website data of the given types modified in the past timespan.
If timespan is 0, all website data will be removed.
When the operation is finished, callback will be called. You can then call
WebKit2.WebsiteDataManager.clear_finish() to get the result of the operation.Due to implementation limitations, this function does not currently delete any stored cookies if timespan is nonzero. This behavior may change in the future.
New in version 2.16.
- clear_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
Trueif website data was successfully cleared, orFalseotherwise.- Return type:
Finish an asynchronous operation started with
WebKit2.WebsiteDataManager.clear()New in version 2.16.
- fetch(types, 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 list of
WebKit2.WebsiteDatafor the given types.When the operation is finished, callback will be called. You can then call
WebKit2.WebsiteDataManager.fetch_finish() to get the result of the operation.New in version 2.16.
- fetch_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
a
GLib.ListofWebKit2.WebsiteData. You must free theGLib.Listwith g_list_free() and unref theWebKit2.WebsiteDatas withWebKit2.WebsiteData.unref() when you’re done with them.- Return type:
Finish an asynchronous operation started with
WebKit2.WebsiteDataManager.fetch().New in version 2.16.
- get_base_cache_directory()¶
- Returns:
the base directory for caches, or
NoneifWebKit2.WebsiteDataManager:base-cache-directorywas not provided or self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:base-cache-directoryproperty.New in version 2.10.
- get_base_data_directory()¶
- Returns:
the base directory for website data, or
NoneifWebKit2.WebsiteDataManager:base-data-directorywas not provided or self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:base-data-directoryproperty.New in version 2.10.
- get_cookie_manager()¶
- Returns:
- Return type:
Get the
WebKit2.CookieManagerof self.New in version 2.16.
- get_disk_cache_directory()¶
- Returns:
the directory where HTTP disk cache is stored or
Noneif self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:disk-cache-directoryproperty.New in version 2.10.
Deprecated since version 2.40: , use
WebKit2.WebsiteDataManager.get_base_cache_directory() instead.
- get_dom_cache_directory()¶
- Returns:
the directory where DOM cache is stored or
Noneif self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:dom-cache-directoryproperty.New in version 2.30.
Deprecated since version 2.40: , use
WebKit2.WebsiteDataManager.get_base_cache_directory() instead.
- get_hsts_cache_directory()¶
- Returns:
the directory where the HSTS cache is stored or
Noneif self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:hsts-cache-directoryproperty.New in version 2.26.
Deprecated since version 2.40: , use
WebKit2.WebsiteDataManager.get_base_cache_directory() instead.
- get_indexeddb_directory()¶
- Returns:
the directory where IndexedDB databases are stored or
Noneif self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:indexeddb-directoryproperty.New in version 2.10.
Deprecated since version 2.40: , use
WebKit2.WebsiteDataManager.get_base_data_directory() instead.
- get_itp_directory()¶
- Returns:
the directory where Intelligent Tracking Prevention data is stored or
Noneif self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:itp-directoryproperty.New in version 2.30.
Deprecated since version 2.40: , use
WebKit2.WebsiteDataManager.get_base_data_directory() instead.
- get_itp_enabled()¶
-
Get whether Intelligent Tracking Prevention (ITP) is enabled or not.
New in version 2.30.
- get_itp_summary(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 list of
WebKit2.ITPThirdPartyseen for self.Every
WebKit2.ITPThirdPartycontains the list ofWebKit2.ITPFirstPartyunder which it has been seen.When the operation is finished, callback will be called. You can then call
WebKit2.WebsiteDataManager.get_itp_summary_finish() to get the result of the operation.New in version 2.30.
- get_itp_summary_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
a
GLib.ListofWebKit2.ITPThirdParty. You must free theGLib.Listwith g_list_free() and unref theWebKit2.ITPThirdPartys withWebKit2.ITPThirdParty.unref() when you’re done with them.- Return type:
Finish an asynchronous operation started with
WebKit2.WebsiteDataManager.get_itp_summary().New in version 2.30.
- get_local_storage_directory()¶
- Returns:
the directory where local storage data is stored or
Noneif self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:local-storage-directoryproperty.New in version 2.10.
Deprecated since version 2.40: , use
WebKit2.WebsiteDataManager.get_base_data_directory() instead.
- get_offline_application_cache_directory()¶
- Returns:
the directory where offline web application cache is stored or
Noneif self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:offline-application-cache-directoryproperty.New in version 2.10.
Deprecated since version 2.40: , use
WebKit2.WebsiteDataManager.get_base_cache_directory() instead.
- get_persistent_credential_storage_enabled()¶
-
Get whether persistent credential storage is enabled or not.
See also
WebKit2.WebsiteDataManager.set_persistent_credential_storage_enabled().New in version 2.30.
- get_service_worker_registrations_directory()¶
- Returns:
the directory where service worker registrations are stored or
Noneif self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:service-worker-registrations-directoryproperty.New in version 2.30.
Deprecated since version 2.40: , use
WebKit2.WebsiteDataManager.get_base_data_directory() instead.
- get_tls_errors_policy()¶
- Returns:
- Return type:
Get the TLS errors policy of self.
New in version 2.32.
- get_websql_directory()¶
- Returns:
the directory where WebSQL databases are stored or
Noneif self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager:websql-directoryproperty.New in version 2.10.
Deprecated since version 2.24.: WebSQL is no longer supported. Use IndexedDB instead.
- is_ephemeral()¶
-
Get whether a
WebKit2.WebsiteDataManageris ephemeral.See
WebKit2.WebsiteDataManager:is-ephemeralfor more details.New in version 2.16.
- remove(types, website_data, cancellable, callback, *user_data)¶
- Parameters:
website_data ([
WebKit2.WebsiteData]) – aGLib.ListofWebKit2.WebsiteDatacancellable (
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 removes the website data in the given website_data list.
Asynchronously removes the website data of the given types for websites in the given website_data list. Use
WebKit2.WebsiteDataManager.clear() if you want to remove the website data for all sites.When the operation is finished, callback will be called. You can then call
WebKit2.WebsiteDataManager.remove_finish() to get the result of the operation.New in version 2.16.
- remove_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
Trueif website data resources were successfully removed, orFalseotherwise.- Return type:
Finish an asynchronous operation started with
WebKit2.WebsiteDataManager.remove().New in version 2.16.
- set_itp_enabled(enabled)¶
- Parameters:
enabled (
bool) – value to set
Enable or disable Intelligent Tracking Prevention (ITP).
When ITP is enabled resource load statistics are collected and used to decide whether to allow or block third-party cookies and prevent user tracking. Note that while ITP is enabled the accept policy
WebKit2.CookieAcceptPolicy.NO_THIRD_PARTYis ignored andWebKit2.CookieAcceptPolicy.ALWAYSis used instead. See alsoWebKit2.CookieManager.set_accept_policy().New in version 2.30.
- set_network_proxy_settings(proxy_mode, proxy_settings)¶
- Parameters:
proxy_mode (
WebKit2.NetworkProxyMode) – aWebKit2.NetworkProxyModeproxy_settings (
WebKit2.NetworkProxySettingsorNone) – aWebKit2.NetworkProxySettings, orNone
Set the network proxy settings to be used by connections started in self session.
By default
WebKit2.NetworkProxyMode.DEFAULTis used, which means that the system settings will be used (Gio.ProxyResolver.get_default()). If you want to override the system default settings, you can either useWebKit2.NetworkProxyMode.NO_PROXYto make sure no proxies are used at all, orWebKit2.NetworkProxyMode.CUSTOMto provide your own proxy settings. When proxy_mode isWebKit2.NetworkProxyMode.CUSTOMproxy_settings must be a validWebKit2.NetworkProxySettings; otherwise, proxy_settings must beNone.New in version 2.32.
- set_persistent_credential_storage_enabled(enabled)¶
- Parameters:
enabled (
bool) – value to set
Enable or disable persistent credential storage.
When enabled, which is the default for non-ephemeral sessions, the network process will try to read and write HTTP authentiacation credentials from persistent storage.
New in version 2.30.
- set_tls_errors_policy(policy)¶
- Parameters:
policy (
WebKit2.TLSErrorsPolicy) – aWebKit2.TLSErrorsPolicy
Set the TLS errors policy of self as policy.
New in version 2.32.
Property Details¶
- WebKit2.WebsiteDataManager.props.base_cache_directory¶
- Name:
base-cache-directory- Type:
- Default Value:
- Flags:
The base directory for caches. If
None, a default location will be used.New in version 2.10.
- WebKit2.WebsiteDataManager.props.base_data_directory¶
- Name:
base-data-directory- Type:
- Default Value:
- Flags:
The base directory for website data. If
None, a default location will be used.New in version 2.10.
- WebKit2.WebsiteDataManager.props.disk_cache_directory¶
- Name:
disk-cache-directory- Type:
- Default Value:
- Flags:
The directory where HTTP disk cache will be stored.
New in version 2.10.
Deprecated since version 2.40.: Use
WebKit2.WebsiteDataManager:base-cache-directoryinstead.
- WebKit2.WebsiteDataManager.props.dom_cache_directory¶
- Name:
dom-cache-directory- Type:
- Default Value:
- Flags:
The directory where DOM cache will be stored.
New in version 2.30.
Deprecated since version 2.40.: Use
WebKit2.WebsiteDataManager:base-cache-directoryinstead.
- WebKit2.WebsiteDataManager.props.hsts_cache_directory¶
- Name:
hsts-cache-directory- Type:
- Default Value:
- Flags:
The directory where the HTTP Strict-Transport-Security (HSTS) cache will be stored.
New in version 2.26.
Deprecated since version 2.40.: Use
WebKit2.WebsiteDataManager:base-cache-directoryinstead.
- WebKit2.WebsiteDataManager.props.indexeddb_directory¶
- Name:
indexeddb-directory- Type:
- Default Value:
- Flags:
The directory where IndexedDB databases will be stored.
New in version 2.10.
Deprecated since version 2.40.: Use
WebKit2.WebsiteDataManager:base-data-directoryinstead.
- WebKit2.WebsiteDataManager.props.is_ephemeral¶
- Name:
is-ephemeral- Type:
- Default Value:
- Flags:
Whether the
WebKit2.WebsiteDataManageris ephemeral. An ephemeralWebKit2.WebsiteDataManagerhandles all websites data as non-persistent, and nothing will be written to the client storage. Note that if you create an ephemeralWebKit2.WebsiteDataManagerall other construction parameters to configure data directories will be ignored.New in version 2.16.
- WebKit2.WebsiteDataManager.props.itp_directory¶
- Name:
itp-directory- Type:
- Default Value:
- Flags:
The directory where Intelligent Tracking Prevention (ITP) data will be stored.
New in version 2.30.
Deprecated since version 2.40.: Use
WebKit2.WebsiteDataManager:base-data-directoryinstead.
- WebKit2.WebsiteDataManager.props.local_storage_directory¶
- Name:
local-storage-directory- Type:
- Default Value:
- Flags:
The directory where local storage data will be stored.
New in version 2.10.
Deprecated since version 2.40.: Use
WebKit2.WebsiteDataManager:base-data-directoryinstead.
- WebKit2.WebsiteDataManager.props.offline_application_cache_directory¶
- Name:
offline-application-cache-directory- Type:
- Default Value:
- Flags:
The directory where offline web application cache will be stored.
New in version 2.10.
Deprecated since version 2.40.: Use
WebKit2.WebsiteDataManager:base-cache-directoryinstead.
- WebKit2.WebsiteDataManager.props.origin_storage_ratio¶
- Name:
origin-storage-ratio- Type:
- Default Value:
-1.0- Flags:
The percentage of volume space that can be used for data storage for every domain. If the maximum storage is reached the storage request will fail with a QuotaExceededError exception. A value of 0.0 means that data storage is not allowed. A value of -1.0, which is the default, means WebKit will use the default quota (1 GiB).
New in version 2.42.
- WebKit2.WebsiteDataManager.props.service_worker_registrations_directory¶
- Name:
service-worker-registrations-directory- Type:
- Default Value:
- Flags:
The directory where service workers registrations will be stored.
New in version 2.30.
Deprecated since version 2.40.: Use
WebKit2.WebsiteDataManager:base-data-directoryinstead.
- WebKit2.WebsiteDataManager.props.total_storage_ratio¶
- Name:
total-storage-ratio- Type:
- Default Value:
-1.0- Flags:
The percentage of volume space that can be used for data storage for all domains. If the maximum storage is reached the eviction will happen. A value of 0.0 means that data storage is not allowed. A value of -1.0, which is the default, means there’s no limit for the total storage.
New in version 2.42.
- WebKit2.WebsiteDataManager.props.websql_directory¶
- Name:
websql-directory- Type:
- Default Value:
- Flags:
The directory where WebSQL databases will be stored.
New in version 2.10.
Deprecated since version 2.24.: WebSQL is no longer supported. Use IndexedDB instead.