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.WebsiteDataManager
to configure the local directories where website data will be stored. UseWebKit2.WebsiteDataManager
:base-data-directory
andWebKit2.WebsiteDataManager
:base-cache-directory
set a common base directory for all website data and caches.A
WebKit2.WebsiteDataManager
can be ephemeral, in which case all the directory configuration is not needed because website data will never persist. You can create an ephemeralWebKit2.WebsiteDataManager
withWebKit2.WebsiteDataManager.new_ephemeral
().WebKit2.WebsiteDataManager
can 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-ephemeral
for 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.MemoryPressureSettings
to be used by all the network processes created by any instance ofWebKit2.WebsiteDataManager
after 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
None
as the value of settings.New in version 2.34.
- clear(types, timespan, cancellable, callback, *user_data)¶
- Parameters:
timespan (
int
) – a #GTimeSpancancellable (
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 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:
True
if website data was successfully cleared, orFalse
otherwise.- 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.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 list of
WebKit2.WebsiteData
for 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.List
ofWebKit2.WebsiteData
. You must free theGLib.List
with g_list_free() and unref theWebKit2.WebsiteData
s 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
None
ifWebKit2.WebsiteDataManager
:base-cache-directory
was not provided or self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:base-cache-directory
property.New in version 2.10.
- get_base_data_directory()¶
- Returns:
the base directory for website data, or
None
ifWebKit2.WebsiteDataManager
:base-data-directory
was not provided or self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:base-data-directory
property.New in version 2.10.
- get_cookie_manager()¶
- Returns:
- Return type:
Get the
WebKit2.CookieManager
of self.New in version 2.16.
- get_disk_cache_directory()¶
- Returns:
the directory where HTTP disk cache is stored or
None
if self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:disk-cache-directory
property.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
None
if self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:dom-cache-directory
property.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
None
if self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:hsts-cache-directory
property.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
None
if self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:indexeddb-directory
property.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
None
if self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:itp-directory
property.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.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 list of
WebKit2.ITPThirdParty
seen for self.Every
WebKit2.ITPThirdParty
contains the list ofWebKit2.ITPFirstParty
under 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.List
ofWebKit2.ITPThirdParty
. You must free theGLib.List
with g_list_free() and unref theWebKit2.ITPThirdParty
s 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
None
if self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:local-storage-directory
property.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
None
if self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:offline-application-cache-directory
property.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
None
if self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:service-worker-registrations-directory
property.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
None
if self is ephemeral.- Return type:
Get the
WebKit2.WebsiteDataManager
:websql-directory
property.New in version 2.10.
Deprecated since version 2.24.: WebSQL is no longer supported. Use IndexedDB instead.
- is_ephemeral()¶
-
Get whether a
WebKit2.WebsiteDataManager
is ephemeral.See
WebKit2.WebsiteDataManager
:is-ephemeral
for more details.New in version 2.16.
- remove(types, website_data, cancellable, callback, *user_data)¶
- Parameters:
website_data ([
WebKit2.WebsiteData
]) – aGLib.List
ofWebKit2.WebsiteData
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 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:
True
if website data resources were successfully removed, orFalse
otherwise.- 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_PARTY
is ignored andWebKit2.CookieAcceptPolicy.ALWAYS
is 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.NetworkProxyMode
proxy_settings (
WebKit2.NetworkProxySettings
orNone
) – aWebKit2.NetworkProxySettings
, orNone
Set the network proxy settings to be used by connections started in self session.
By default
WebKit2.NetworkProxyMode.DEFAULT
is 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_PROXY
to make sure no proxies are used at all, orWebKit2.NetworkProxyMode.CUSTOM
to provide your own proxy settings. When proxy_mode isWebKit2.NetworkProxyMode.CUSTOM
proxy_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-directory
instead.
- 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-directory
instead.
- 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-directory
instead.
- 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-directory
instead.
- WebKit2.WebsiteDataManager.props.is_ephemeral¶
- Name:
is-ephemeral
- Type:
- Default Value:
- Flags:
Whether the
WebKit2.WebsiteDataManager
is ephemeral. An ephemeralWebKit2.WebsiteDataManager
handles all websites data as non-persistent, and nothing will be written to the client storage. Note that if you create an ephemeralWebKit2.WebsiteDataManager
all 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-directory
instead.
- 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-directory
instead.
- 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-directory
instead.
- 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-directory
instead.
- 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.