Top |
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 |
GBoxed ├── WebKitITPFirstParty ╰── WebKitITPThirdParty GObject ╰── WebKitWebsiteDataManager
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.
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.
first_option_name |
name of the first option to set |
|
... |
value of first option, followed by more options, |
Since: 2.10
WebKitWebsiteDataManager *
webkit_website_data_manager_new_ephemeral
(void
);
Creates an ephemeral WebKitWebsiteDataManager. See “is-ephemeral” for more details.
Since: 2.16
gboolean
webkit_website_data_manager_is_ephemeral
(WebKitWebsiteDataManager *manager
);
Get whether a WebKitWebsiteDataManager is ephemeral. See “is-ephemeral” for more details.
Since: 2.16
const gchar *
webkit_website_data_manager_get_base_data_directory
(WebKitWebsiteDataManager *manager
);
Get the “base-data-directory” property.
the base directory for Website data, or NULL
if
“base-data-directory” was not provided or manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_base_cache_directory
(WebKitWebsiteDataManager *manager
);
Get the “base-cache-directory” property.
the base directory for Website cache, or NULL
if
“base-cache-directory” was not provided or manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_local_storage_directory
(WebKitWebsiteDataManager *manager
);
Get the “local-storage-directory” property.
the directory where local storage data is stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_disk_cache_directory
(WebKitWebsiteDataManager *manager
);
Get the “disk-cache-directory” property.
Since: 2.10
const gchar *
webkit_website_data_manager_get_offline_application_cache_directory
(WebKitWebsiteDataManager *manager
);
Get the “offline-application-cache-directory” property.
the directory where offline web application cache is stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_indexeddb_directory
(WebKitWebsiteDataManager *manager
);
Get the “indexeddb-directory” property.
the directory where IndexedDB databases are stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.10
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.
the directory where WebSQL databases are stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.10
const gchar *
webkit_website_data_manager_get_hsts_cache_directory
(WebKitWebsiteDataManager *manager
);
Get the “hsts-cache-directory” property.
Since: 2.26
const gchar *
webkit_website_data_manager_get_itp_directory
(WebKitWebsiteDataManager *manager
);
Get the “itp-directory” property.
the directory where Intelligent Tracking Prevention data is stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.30
const gchar *
webkit_website_data_manager_get_service_worker_registrations_directory
(WebKitWebsiteDataManager *manager
);
Get the “service-worker-registrations-directory” property.
the directory where service worker registrations are stored or NULL
if manager
is ephemeral.
[allow-none]
Since: 2.30
const gchar *
webkit_website_data_manager_get_dom_cache_directory
(WebKitWebsiteDataManager *manager
);
Get the “dom-cache-directory” property.
Since: 2.30
WebKitCookieManager *
webkit_website_data_manager_get_cookie_manager
(WebKitWebsiteDataManager *manager
);
Get the WebKitCookieManager of manager
.
Since: 2.16
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 while ITP is enabled the accept policy WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY
is ignored and
WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS
is used instead. See also webkit_cookie_manager_set_accept_policy()
.
Since: 2.30
gboolean
webkit_website_data_manager_get_itp_enabled
(WebKitWebsiteDataManager *manager
);
Get whether Intelligent Tracking Prevention (ITP) is enabled or not.
Since: 2.30
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.
Since: 2.30
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()
.
Since: 2.30
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.
manager |
||
types |
||
cancellable |
a GCancellable or |
[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
GList * webkit_website_data_manager_fetch_finish (WebKitWebsiteDataManager *manager
,GAsyncResult *result
,GError **error
);
Finish an asynchronous operation started with webkit_website_data_manager_fetch()
.
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
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.
manager |
||
types |
||
website_data |
a GList of WebKitWebsiteData. |
[element-type WebKitWebsiteData] |
cancellable |
a GCancellable or |
[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
gboolean webkit_website_data_manager_remove_finish (WebKitWebsiteDataManager *manager
,GAsyncResult *result
,GError **error
);
Finish an asynchronous operation started with webkit_website_data_manager_remove()
.
Since: 2.16
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.
manager |
||
types |
||
timespan |
||
cancellable |
a GCancellable or |
[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
gboolean webkit_website_data_manager_clear_finish (WebKitWebsiteDataManager *manager
,GAsyncResult *result
,GError **error
);
Finish an asynchronous operation started with webkit_website_data_manager_clear()
Since: 2.16
WebKitITPFirstParty *
webkit_itp_first_party_ref (WebKitITPFirstParty *itp_first_party
);
Atomically increments the reference count of itp_first_party
by one.
This function is MT-safe and may be called from any thread.
Since: 2.30
void
webkit_itp_first_party_unref (WebKitITPFirstParty *itp_first_party
);
Atomically decrements the reference count of itp_first_party
by one.
If the reference count drops to 0, all memory allocated by
WebKitITPFirstParty is released. This function is MT-safe and may be
called from any thread.
Since: 2.30
const char *
webkit_itp_first_party_get_domain (WebKitITPFirstParty *itp_first_party
);
Get the domain name of itp_first_party
Since: 2.30
gboolean
webkit_itp_first_party_get_website_data_access_allowed
(WebKitITPFirstParty *itp_first_party
);
Get whether itp_first_party
has granted website data access to its WebKitITPThirdParty.
Each WebKitITPFirstParty
is created by webkit_itp_third_party_get_first_parties()
and
therefore corresponds to exactly one WebKitITPThirdParty.
Since: 2.30
GDateTime *
webkit_itp_first_party_get_last_update_time
(WebKitITPFirstParty *itp_first_party
);
Get the last time a WebKitITPThirdParty has been seen under itp_first_party
.
Each WebKitITPFirstParty
is created by webkit_itp_third_party_get_first_parties()
and
therefore corresponds to exactly one WebKitITPThirdParty.
Since: 2.30
WebKitITPThirdParty *
webkit_itp_third_party_ref (WebKitITPThirdParty *itp_third_party
);
Atomically increments the reference count of itp_third_party
by one.
This function is MT-safe and may be called from any thread.
Since: 2.30
void
webkit_itp_third_party_unref (WebKitITPThirdParty *itp_third_party
);
Atomically decrements the reference count of itp_third_party
by one.
If the reference count drops to 0, all memory allocated by
WebKitITPThirdParty is released. This function is MT-safe and may be
called from any thread.
Since: 2.30
const char *
webkit_itp_third_party_get_domain (WebKitITPThirdParty *itp_third_party
);
Get the domain name of itp_third_party
Since: 2.30
GList *
webkit_itp_third_party_get_first_parties
(WebKitITPThirdParty *itp_third_party
);
Get the list of WebKitITPFirstParty under which itp_third_party
has been seen.
Since: 2.30
void webkit_website_data_manager_get_itp_summary (WebKitWebsiteDataManager *manager
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously get the list of WebKitITPThirdParty seen for manager
. Every WebKitITPThirdParty
contains the list of WebKitITPFirstParty under which it has been seen.
When the operation is finished, callback
will be called. You can then call
webkit_website_data_manager_get_itp_summary_finish()
to get the result of the operation.
manager |
||
cancellable |
a GCancellable or |
[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.30
GList * webkit_website_data_manager_get_itp_summary_finish (WebKitWebsiteDataManager *manager
,GAsyncResult *result
,GError **error
);
Finish an asynchronous operation started with webkit_website_data_manager_get_itp_summary()
.
a GList of WebKitITPThirdParty.
You must free the GList with g_list_free()
and unref the WebKitITPThirdPartys with
webkit_itp_third_party_unref()
when you're done with them.
[transfer full][element-type WebKitITPThirdParty]
Since: 2.30
“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
“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
“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
“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
“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
“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
“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
“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
“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
“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
“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
“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