WebKit.WebsiteDataManager

g GObject.Object GObject.Object WebKit.WebsiteDataManager WebKit.WebsiteDataManager GObject.Object->WebKit.WebsiteDataManager

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

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_favicon_database ()

get_favicons_enabled ()

get_itp_summary (cancellable, callback, *user_data)

get_itp_summary_finish (result)

is_ephemeral ()

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

remove_finish (result)

set_favicons_enabled (enabled)

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

is-ephemeral

bool

r/w/co

origin-storage-ratio

float

w/co

total-storage-ratio

float

w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class WebKit.WebsiteDataManager(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit.WebsiteDataManagerClass

Manages data stored locally by web sites.

You can use WebKit.WebsiteDataManager to configure the local directories where website data will be stored. Use WebKit.WebsiteDataManager :base-data-directory and WebKit.WebsiteDataManager :base-cache-directory set a common base directory for all website data and caches.

A WebKit.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 WebKit.WebsiteDataManager with webkit_website_data_manager_new_ephemeral().

WebKit.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.

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 WebKit.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 WebKit.WebsiteDataManager.clear()

New in version 2.16.

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

Asynchronously get the list of WebKit.WebsiteData for the given types.

When the operation is finished, callback will be called. You can then call WebKit.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 WebKit.WebsiteData. You must free the GLib.List with g_list_free() and unref the WebKit.WebsiteData s with WebKit.WebsiteData.unref() when you’re done with them.

Return type:

[WebKit.WebsiteData]

Finish an asynchronous operation started with WebKit.WebsiteDataManager.fetch().

New in version 2.16.

get_base_cache_directory()
Returns:

the base directory for caches, or None if WebKit.WebsiteDataManager :base-cache-directory was not provided or self is ephemeral.

Return type:

str or None

Get the WebKit.WebsiteDataManager :base-cache-directory property.

New in version 2.10.

get_base_data_directory()
Returns:

the base directory for website data, or None if WebKit.WebsiteDataManager :base-data-directory was not provided or self is ephemeral.

Return type:

str or None

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

New in version 2.10.

get_favicon_database()
Returns:

a WebKit.FaviconDatabase, or None if website icons are disabled

Return type:

WebKit.FaviconDatabase or None

Get the WebKit.FaviconDatabase of self.

New in version 2.40.

get_favicons_enabled()
Returns:

True if website icons are enabled, or False otherwise.

Return type:

bool

Get whether website icons are enabled.

New in version 2.40.

get_itp_summary(cancellable, callback, *user_data)
Parameters:

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

Every WebKit.ITPThirdParty contains the list of WebKit.ITPFirstParty under which it has been seen.

When the operation is finished, callback will be called. You can then call WebKit.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 WebKit.ITPThirdParty. You must free the GLib.List with g_list_free() and unref the WebKit.ITPThirdParty s with WebKit.ITPThirdParty.unref() when you’re done with them.

Return type:

[WebKit.ITPThirdParty]

Finish an asynchronous operation started with WebKit.WebsiteDataManager.get_itp_summary().

New in version 2.30.

is_ephemeral()
Returns:

True if self is ephemeral or False otherwise.

Return type:

bool

Get whether a WebKit.WebsiteDataManager is ephemeral.

See WebKit.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 WebKit.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 WebKit.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 WebKit.WebsiteDataManager.remove().

New in version 2.16.

set_favicons_enabled(enabled)
Parameters:

enabled (bool) – value to set

Set whether website icons are enabled. Website icons are disabled by default. When website icons are disabled, the WebKit.FaviconDatabase of self is closed and its reference removed, so WebKit.WebsiteDataManager.get_favicon_database() will return None. If website icons are enabled again, a new WebKit.FaviconDatabase will be created.

New in version 2.40.

Property Details

WebKit.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.

WebKit.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.

WebKit.WebsiteDataManager.props.is_ephemeral
Name:

is-ephemeral

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether the WebKit.WebsiteDataManager is ephemeral. An ephemeral WebKit.WebsiteDataManager handles all websites data as non-persistent, and nothing will be written to the client storage. Note that if you create an ephemeral WebKit.WebsiteDataManager all other construction parameters to configure data directories will be ignored.

New in version 2.16.

WebKit.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.

WebKit.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.