WebKitWebsiteDataManager

WebKitWebsiteDataManager — Website data manager

Functions

WebKitWebsiteDataManager * webkit_website_data_manager_new ()
WebKitWebsiteDataManager * webkit_website_data_manager_new_ephemeral ()
gboolean webkit_website_data_manager_is_ephemeral ()
const gchar * webkit_website_data_manager_get_base_data_directory ()
const gchar * webkit_website_data_manager_get_base_cache_directory ()
const gchar * webkit_website_data_manager_get_local_storage_directory ()
const gchar * webkit_website_data_manager_get_disk_cache_directory ()
const gchar * webkit_website_data_manager_get_offline_application_cache_directory ()
const gchar * webkit_website_data_manager_get_indexeddb_directory ()
const gchar * webkit_website_data_manager_get_websql_directory ()
const gchar * webkit_website_data_manager_get_hsts_cache_directory ()
const gchar * webkit_website_data_manager_get_itp_directory ()
const gchar * webkit_website_data_manager_get_service_worker_registrations_directory ()
const gchar * webkit_website_data_manager_get_dom_cache_directory ()
WebKitCookieManager * webkit_website_data_manager_get_cookie_manager ()
void webkit_website_data_manager_set_itp_enabled ()
gboolean webkit_website_data_manager_get_itp_enabled ()
void webkit_website_data_manager_set_persistent_credential_storage_enabled ()
gboolean webkit_website_data_manager_get_persistent_credential_storage_enabled ()
void webkit_website_data_manager_fetch ()
GList * webkit_website_data_manager_fetch_finish ()
void webkit_website_data_manager_remove ()
gboolean webkit_website_data_manager_remove_finish ()
void webkit_website_data_manager_clear ()
gboolean webkit_website_data_manager_clear_finish ()

Properties

gchar * base-cache-directory Read / Write / Construct Only
gchar * base-data-directory Read / Write / Construct Only
gchar * disk-cache-directory Read / Write / Construct Only
gchar * dom-cache-directory Read / Write / Construct Only
gchar * hsts-cache-directory Read / Write / Construct Only
gchar * indexeddb-directory Read / Write / Construct Only
gboolean is-ephemeral Read / Write / Construct Only
gchar * itp-directory Read / Write / Construct Only
gchar * local-storage-directory Read / Write / Construct Only
gchar * offline-application-cache-directory Read / Write / Construct Only
gchar * service-worker-registrations-directory Read / Write / Construct Only
gchar * websql-directory Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WebKitWebsiteDataManager

Description

WebKitWebsiteDataManager allows you to manage the data that websites can store in the client file system like databases or caches. You can use WebKitWebsiteDataManager to configure the local directories where the Website data will be stored, by creating a new manager with webkit_website_data_manager_new() passing the values you want to set. You can set all the possible configuration values or only some of them, a default value will be used automatically for the configuration options not provided. “base-data-directory” and “base-cache-directory” are two special properties that can be used to set a common base directory for all Website data and caches. It's possible to provide both, a base directory and a specific value, but in that case, the specific value takes precedence over the base directory. The newly created WebKitWebsiteDataManager must be passed as a construct property to a WebKitWebContext, you can use webkit_web_context_new_with_website_data_manager() to create a new WebKitWebContext with a WebKitWebsiteDataManager. In case you don't want to set any specific configuration, you don't need to create a WebKitWebsiteDataManager, the WebKitWebContext will create a WebKitWebsiteDataManager with the default configuration. To get the WebKitWebsiteDataManager of a WebKitWebContext you can use webkit_web_context_get_website_data_manager().

A WebKitWebsiteDataManager can also be ephemeral and then all the directories configuration is not needed because website data will never persist. You can create an ephemeral WebKitWebsiteDataManager with webkit_website_data_manager_new_ephemeral(). Then you can pass an ephemeral WebKitWebsiteDataManager to a WebKitWebContext to make it ephemeral or use webkit_web_context_new_ephemeral() and the WebKitWebsiteDataManager will be automatically created by the WebKitWebContext.

WebKitWebsiteDataManager can also be used to fetch websites data, remove data stored by particular websites, or clear data for all websites modified since a given period of time.

Functions

webkit_website_data_manager_new ()

WebKitWebsiteDataManager *
webkit_website_data_manager_new (const gchar *first_option_name,
                                 ...);

Creates a new WebKitWebsiteDataManager with the given options. It must be passed as construction parameter of a WebKitWebContext.

Parameters

first_option_name

name of the first option to set

 

...

value of first option, followed by more options, NULL-terminated

 

Returns

the newly created WebKitWebsiteDataManager.

[transfer full]

Since: 2.10


webkit_website_data_manager_new_ephemeral ()

WebKitWebsiteDataManager *
webkit_website_data_manager_new_ephemeral
                               (void);

Creates an ephemeral WebKitWebsiteDataManager. See “is-ephemeral” for more details.

Returns

a new ephemeral WebKitWebsiteDataManager.

[transfer full]

Since: 2.16


webkit_website_data_manager_is_ephemeral ()

gboolean
webkit_website_data_manager_is_ephemeral
                               (WebKitWebsiteDataManager *manager);

Get whether a WebKitWebsiteDataManager is ephemeral. See “is-ephemeral” for more details.

Parameters

Returns

TRUE if manager is ephemeral or FALSE otherwise.

Since: 2.16


webkit_website_data_manager_get_base_data_directory ()

const gchar *
webkit_website_data_manager_get_base_data_directory
                               (WebKitWebsiteDataManager *manager);

Get the “base-data-directory” property.

Parameters

Returns

the base directory for Website data, or NULL if “base-data-directory” was not provided or manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_base_cache_directory ()

const gchar *
webkit_website_data_manager_get_base_cache_directory
                               (WebKitWebsiteDataManager *manager);

Get the “base-cache-directory” property.

Parameters

Returns

the base directory for Website cache, or NULL if “base-cache-directory” was not provided or manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_local_storage_directory ()

const gchar *
webkit_website_data_manager_get_local_storage_directory
                               (WebKitWebsiteDataManager *manager);

Get the “local-storage-directory” property.

Parameters

Returns

the directory where local storage data is stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_disk_cache_directory ()

const gchar *
webkit_website_data_manager_get_disk_cache_directory
                               (WebKitWebsiteDataManager *manager);

Get the “disk-cache-directory” property.

Parameters

Returns

the directory where HTTP disk cache is stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_offline_application_cache_directory ()

const gchar *
webkit_website_data_manager_get_offline_application_cache_directory
                               (WebKitWebsiteDataManager *manager);

Get the “offline-application-cache-directory” property.

Parameters

Returns

the directory where offline web application cache is stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_indexeddb_directory ()

const gchar *
webkit_website_data_manager_get_indexeddb_directory
                               (WebKitWebsiteDataManager *manager);

Get the “indexeddb-directory” property.

Parameters

Returns

the directory where IndexedDB databases are stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_websql_directory ()

const gchar *
webkit_website_data_manager_get_websql_directory
                               (WebKitWebsiteDataManager *manager);

webkit_website_data_manager_get_websql_directory has been deprecated since version 2.24. and should not be used in newly-written code.

WebSQL is no longer supported. Use IndexedDB instead.

Get the “websql-directory” property.

Parameters

Returns

the directory where WebSQL databases are stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.10


webkit_website_data_manager_get_hsts_cache_directory ()

const gchar *
webkit_website_data_manager_get_hsts_cache_directory
                               (WebKitWebsiteDataManager *manager);

Get the “hsts-cache-directory” property.

Parameters

Returns

the directory where the HSTS cache is stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.26


webkit_website_data_manager_get_itp_directory ()

const gchar *
webkit_website_data_manager_get_itp_directory
                               (WebKitWebsiteDataManager *manager);

Get the “itp-directory” property.

Parameters

Returns

the directory where Intelligent Tracking Prevention data is stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.30


webkit_website_data_manager_get_service_worker_registrations_directory ()

const gchar *
webkit_website_data_manager_get_service_worker_registrations_directory
                               (WebKitWebsiteDataManager *manager);

Get the “service-worker-registrations-directory” property.

Parameters

Returns

the directory where service worker registrations are stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.30


webkit_website_data_manager_get_dom_cache_directory ()

const gchar *
webkit_website_data_manager_get_dom_cache_directory
                               (WebKitWebsiteDataManager *manager);

Get the “dom-cache-directory” property.

Parameters

Returns

the directory where DOM cache is stored or NULL if manager is ephemeral.

[allow-none]

Since: 2.30


webkit_website_data_manager_get_cookie_manager ()

WebKitCookieManager *
webkit_website_data_manager_get_cookie_manager
                               (WebKitWebsiteDataManager *manager);

Get the WebKitCookieManager of manager .

Parameters

Returns

a WebKitCookieManager.

[transfer none]

Since: 2.16


webkit_website_data_manager_set_itp_enabled ()

void
webkit_website_data_manager_set_itp_enabled
                               (WebKitWebsiteDataManager *manager,
                                gboolean enabled);

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 when ITP is enabled the resources for which cookies are allowed will follow the accept policy set with webkit_cookie_manager_set_accept_policy().

Parameters

manager

a WebKitWebsiteDataManager

 

enabled

value to set

 

Since: 2.30


webkit_website_data_manager_get_itp_enabled ()

gboolean
webkit_website_data_manager_get_itp_enabled
                               (WebKitWebsiteDataManager *manager);

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

Parameters

Returns

TRUE if ITP is enabled, or FALSE otherwise.

Since: 2.30


webkit_website_data_manager_set_persistent_credential_storage_enabled ()

void
webkit_website_data_manager_set_persistent_credential_storage_enabled
                               (WebKitWebsiteDataManager *manager,
                                gboolean enabled);

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.

Parameters

manager

a WebKitWebsiteDataManager

 

enabled

value to set

 

Since: 2.30


webkit_website_data_manager_get_persistent_credential_storage_enabled ()

gboolean
webkit_website_data_manager_get_persistent_credential_storage_enabled
                               (WebKitWebsiteDataManager *manager);

Get whether persistent credential storage is enabled or not. See also webkit_website_data_manager_set_persistent_credential_storage_enabled().

Parameters

Returns

TRUE if persistent credential storage is enabled, or FALSE otherwise.

Since: 2.30


webkit_website_data_manager_fetch ()

void
webkit_website_data_manager_fetch (WebKitWebsiteDataManager *manager,
                                   WebKitWebsiteDataTypes types,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Asynchronously get the list of WebKitWebsiteData for the given types .

When the operation is finished, callback will be called. You can then call webkit_website_data_manager_fetch_finish() to get the result of the operation.

Parameters

manager

a WebKitWebsiteDataManager

 

types

WebKitWebsiteDataTypes

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 2.16


webkit_website_data_manager_fetch_finish ()

GList *
webkit_website_data_manager_fetch_finish
                               (WebKitWebsiteDataManager *manager,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_website_data_manager_fetch().

Parameters

manager

a WebKitWebsiteDataManager

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

a GList of WebKitWebsiteData. You must free the GList with g_list_free() and unref the WebKitWebsiteDatas with webkit_website_data_unref() when you're done with them.

[element-type WebKitWebsiteData][transfer full]

Since: 2.16


webkit_website_data_manager_remove ()

void
webkit_website_data_manager_remove (WebKitWebsiteDataManager *manager,
                                    WebKitWebsiteDataTypes types,
                                    GList *website_data,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Asynchronously removes the website data of the for the given types for websites in the given website_data list. Use webkit_website_data_manager_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_website_data_manager_remove_finish() to get the result of the operation.

Parameters

manager

a WebKitWebsiteDataManager

 

types

WebKitWebsiteDataTypes

 

website_data

a GList of WebKitWebsiteData.

[element-type WebKitWebsiteData]

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 2.16


webkit_website_data_manager_remove_finish ()

gboolean
webkit_website_data_manager_remove_finish
                               (WebKitWebsiteDataManager *manager,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_website_data_manager_remove().

Parameters

manager

a WebKitWebsiteDataManager

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

TRUE if website data resources were successfully removed, or FALSE otherwise.

Since: 2.16


webkit_website_data_manager_clear ()

void
webkit_website_data_manager_clear (WebKitWebsiteDataManager *manager,
                                   WebKitWebsiteDataTypes types,
                                   GTimeSpan timespan,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

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

Parameters

manager

a WebKitWebsiteDataManager

 

types

WebKitWebsiteDataTypes

 

timespan

a GTimeSpan

 

cancellable

a GCancellable or NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 2.16


webkit_website_data_manager_clear_finish ()

gboolean
webkit_website_data_manager_clear_finish
                               (WebKitWebsiteDataManager *manager,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous operation started with webkit_website_data_manager_clear()

Parameters

manager

a WebKitWebsiteDataManager

 

result

a GAsyncResult

 

error

return location for error or NULL to ignore

 

Returns

TRUE if website data was successfully cleared, or FALSE otherwise.

Since: 2.16

Types and Values

struct WebKitWebsiteDataManager

struct WebKitWebsiteDataManager;

Property Details

The “base-cache-directory” property

  “base-cache-directory”     gchar *

The base directory for Website cache. This is used as a base directory for any Website cache when no specific cache directory has been provided.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “base-data-directory” property

  “base-data-directory”      gchar *

The base directory for Website data. This is used as a base directory for any Website data when no specific data directory has been provided.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “disk-cache-directory” property

  “disk-cache-directory”     gchar *

The directory where HTTP disk cache will be stored.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “dom-cache-directory” property

  “dom-cache-directory”      gchar *

The directory where DOM cache will be stored.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.30


The “hsts-cache-directory” property

  “hsts-cache-directory”     gchar *

The directory where the HTTP Strict-Transport-Security (HSTS) cache will be stored.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.26


The “indexeddb-directory” property

  “indexeddb-directory”      gchar *

The directory where IndexedDB databases will be stored.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “is-ephemeral” property

  “is-ephemeral”             gboolean

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

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 2.16


The “itp-directory” property

  “itp-directory”            gchar *

The directory where Intelligent Tracking Prevention (ITP) data will be stored.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.30


The “local-storage-directory” property

  “local-storage-directory”  gchar *

The directory where local storage data will be stored.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “offline-application-cache-directory” property

  “offline-application-cache-directory” gchar *

The directory where offline web application cache will be stored.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10


The “service-worker-registrations-directory” property

  “service-worker-registrations-directory” gchar *

The directory where service workers registrations will be stored.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.30


The “websql-directory” property

  “websql-directory”         gchar *

The directory where WebSQL databases will be stored.

WebKitWebsiteDataManager:websql-directory has been deprecated since version 2.24. and should not be used in newly-written code.

WebSQL is no longer supported. Use IndexedDB instead.

Owner: WebKitWebsiteDataManager

Flags: Read / Write / Construct Only

Default value: NULL

Since: 2.10

See Also

WebKitWebContext, WebKitWebsiteData