WebKit2.WebsiteDataManager

g GObject.Object GObject.Object WebKit2.WebsiteDataManager WebKit2.WebsiteDataManager GObject.Object->WebKit2.WebsiteDataManager

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new_ephemeral ()

class

set_memory_pressure_settings (settings)

clear (types, timespan, cancellable, callback, *user_data)

clear_finish (result)

fetch (types, cancellable, callback, *user_data)

fetch_finish (result)

get_base_cache_directory ()

get_base_data_directory ()

get_cookie_manager ()

get_disk_cache_directory ()

get_dom_cache_directory ()

get_hsts_cache_directory ()

get_indexeddb_directory ()

get_itp_directory ()

get_itp_enabled ()

get_itp_summary (cancellable, callback, *user_data)

get_itp_summary_finish (result)

get_local_storage_directory ()

get_offline_application_cache_directory ()

get_persistent_credential_storage_enabled ()

get_service_worker_registrations_directory ()

get_tls_errors_policy ()

get_websql_directory ()

is_ephemeral ()

remove (types, website_data, cancellable, callback, *user_data)

remove_finish (result)

set_itp_enabled (enabled)

set_network_proxy_settings (proxy_mode, proxy_settings)

set_persistent_credential_storage_enabled (enabled)

set_tls_errors_policy (policy)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

base-cache-directory

str

r/w/co

base-data-directory

str

r/w/co

disk-cache-directory

str

d/r/w/co

deprecated

dom-cache-directory

str

d/r/w/co

deprecated

hsts-cache-directory

str

d/r/w/co

deprecated

indexeddb-directory

str

d/r/w/co

deprecated

is-ephemeral

bool

r/w/co

itp-directory

str

d/r/w/co

deprecated

local-storage-directory

str

d/r/w/co

deprecated

offline-application-cache-directory

str

d/r/w/co

deprecated

origin-storage-ratio

float

w/co

service-worker-registrations-directory

str

d/r/w/co

deprecated

total-storage-ratio

float

w/co

websql-directory

str

d/r/w/co

deprecated

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2.WebsiteDataManager(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit2.WebsiteDataManagerClass

Manages data stored locally by web sites.

You can use WebKit2.WebsiteDataManager to configure the local directories where website data will be stored. Use WebKit2.WebsiteDataManager :base-data-directory and WebKit2.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 ephemeral WebKit2.WebsiteDataManager with WebKit2.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:

WebKit2.WebsiteDataManager

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) – a WebKit2.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 of WebKit2.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:

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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if website data was successfully cleared, or False otherwise.

Return type:

bool

Finish an asynchronous operation started with WebKit2.WebsiteDataManager.clear()

New in version 2.16.

fetch(types, cancellable, callback, *user_data)
Parameters:

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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a GLib.List of WebKit2.WebsiteData. You must free the GLib.List with g_list_free() and unref the WebKit2.WebsiteData s with WebKit2.WebsiteData.unref() when you’re done with them.

Return type:

[WebKit2.WebsiteData]

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 if WebKit2.WebsiteDataManager :base-cache-directory was not provided or self is ephemeral.

Return type:

str or None

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 if WebKit2.WebsiteDataManager :base-data-directory was not provided or self is ephemeral.

Return type:

str or None

Get the WebKit2.WebsiteDataManager :base-data-directory property.

New in version 2.10.

Returns:

a WebKit2.CookieManager

Return type:

WebKit2.CookieManager

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:

str or None

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:

str or None

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:

str or None

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:

str or None

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:

str or None

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()
Returns:

True if ITP is enabled, or False otherwise.

Return type:

bool

Get whether Intelligent Tracking Prevention (ITP) is enabled or not.

New in version 2.30.

get_itp_summary(cancellable, callback, *user_data)
Parameters:

Asynchronously get the list of WebKit2.ITPThirdParty seen for self.

Every WebKit2.ITPThirdParty contains the list of WebKit2.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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a GLib.List of WebKit2.ITPThirdParty. You must free the GLib.List with g_list_free() and unref the WebKit2.ITPThirdParty s with WebKit2.ITPThirdParty.unref() when you’re done with them.

Return type:

[WebKit2.ITPThirdParty]

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:

str or None

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:

str or None

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()
Returns:

True if persistent credential storage is enabled, or False otherwise.

Return type:

bool

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:

str or None

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:

a WebKit2.TLSErrorsPolicy

Return type:

WebKit2.TLSErrorsPolicy

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:

str or None

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()
Returns:

True if self is ephemeral or False otherwise.

Return type:

bool

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:

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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if website data resources were successfully removed, or False otherwise.

Return type:

bool

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 and WebKit2.CookieAcceptPolicy.ALWAYS is used instead. See also WebKit2.CookieManager.set_accept_policy().

New in version 2.30.

set_network_proxy_settings(proxy_mode, proxy_settings)
Parameters:

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 use WebKit2.NetworkProxyMode.NO_PROXY to make sure no proxies are used at all, or WebKit2.NetworkProxyMode.CUSTOM to provide your own proxy settings. When proxy_mode is WebKit2.NetworkProxyMode.CUSTOM proxy_settings must be a valid WebKit2.NetworkProxySettings; otherwise, proxy_settings must be None.

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) – a WebKit2.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:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

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:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

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:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE, CONSTRUCT_ONLY

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:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE, CONSTRUCT_ONLY

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:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE, CONSTRUCT_ONLY

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:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE, CONSTRUCT_ONLY

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:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the WebKit2.WebsiteDataManager is ephemeral. An ephemeral WebKit2.WebsiteDataManager handles all websites data as non-persistent, and nothing will be written to the client storage. Note that if you create an ephemeral WebKit2.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:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE, CONSTRUCT_ONLY

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:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE, CONSTRUCT_ONLY

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:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE, CONSTRUCT_ONLY

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:

float

Default Value:

-1.0

Flags:

WRITABLE, CONSTRUCT_ONLY

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:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE, CONSTRUCT_ONLY

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:

float

Default Value:

-1.0

Flags:

WRITABLE, CONSTRUCT_ONLY

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:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE, CONSTRUCT_ONLY

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.