WebsiteDataManager#
Added in version 2.10.
Superclasses: Object
Manages data stored locally by web sites.
You can use WebKitWebsiteDataManager to configure the local directories
where website data will be stored. Use WebsiteDataManager
:base-data-directory
and WebsiteDataManager
:base-cache-directory set a common base directory for all
website data and caches.
A WebKitWebsiteDataManager can be ephemeral, in which case all the directory configuration is not needed because website data will never persist. You can create an ephemeral WebKitWebsiteDataManager with webkit_website_data_manager_new_ephemeral().
WebKitWebsiteDataManager 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.
Methods#
- class WebsiteDataManager
- clear(types: WebsiteDataTypes, timespan: int, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
Asynchronously clear the website data of the given
types
modified in the pasttimespan
.If
timespan
is 0, all website data will be removed.When the operation is finished,
callback
will be called. You can then callclear_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.Added in version 2.16.
- Parameters:
types –
WebsiteDataTypes
timespan – a
TimeSpan
cancellable – a
Cancellable
orNone
to ignorecallback – a
AsyncReadyCallback
to call when the request is satisfieduser_data – the data to pass to callback function
- clear_finish(result: AsyncResult) bool #
Finish an asynchronous operation started with
clear()
Added in version 2.16.
- Parameters:
result – a
AsyncResult
- fetch(types: WebsiteDataTypes, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
Asynchronously get the list of
WebsiteData
for the giventypes
.When the operation is finished,
callback
will be called. You can then callfetch_finish()
to get the result of the operation.Added in version 2.16.
- Parameters:
types –
WebsiteDataTypes
cancellable – a
Cancellable
orNone
to ignorecallback – a
AsyncReadyCallback
to call when the request is satisfieduser_data – the data to pass to callback function
- fetch_finish(result: AsyncResult) list[WebsiteData] #
Finish an asynchronous operation started with
fetch()
.Added in version 2.16.
- Parameters:
result – a
AsyncResult
- get_base_cache_directory() str | None #
Get the
WebsiteDataManager
:base-cache-directory property.Added in version 2.10.
- get_base_data_directory() str | None #
Get the
WebsiteDataManager
:base-data-directory property.Added in version 2.10.
- get_favicon_database() FaviconDatabase | None #
Get the
FaviconDatabase
ofmanager
.Added in version 2.40.
- get_itp_summary(cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
Asynchronously get the list of
ITPThirdParty
seen formanager
.Every
ITPThirdParty
contains the list ofITPFirstParty
under which it has been seen.When the operation is finished,
callback
will be called. You can then callget_itp_summary_finish()
to get the result of the operation.Added in version 2.30.
- Parameters:
cancellable – a
Cancellable
orNone
to ignorecallback – a
AsyncReadyCallback
to call when the request is satisfieduser_data – the data to pass to callback function
- get_itp_summary_finish(result: AsyncResult) list[ITPThirdParty] #
Finish an asynchronous operation started with
get_itp_summary()
.Added in version 2.30.
- Parameters:
result – a
AsyncResult
- is_ephemeral() bool #
Get whether a
WebsiteDataManager
is ephemeral.See
WebsiteDataManager
:is-ephemeral for more details.Added in version 2.16.
- remove(types: WebsiteDataTypes, website_data: list[WebsiteData], cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
Asynchronously removes the website data in the given
website_data
list.Asynchronously removes the website data of the given
types
for websites in the givenwebsite_data
list. Useclear()
if you want to remove the website data for all sites.When the operation is finished,
callback
will be called. You can then callremove_finish()
to get the result of the operation.Added in version 2.16.
- Parameters:
types –
WebsiteDataTypes
website_data – a
List
ofWebsiteData
cancellable – a
Cancellable
orNone
to ignorecallback – a
AsyncReadyCallback
to call when the request is satisfieduser_data – the data to pass to callback function
- remove_finish(result: AsyncResult) bool #
Finish an asynchronous operation started with
remove()
.Added in version 2.16.
- Parameters:
result – a
AsyncResult
- set_favicons_enabled(enabled: bool) None #
Set whether website icons are enabled. Website icons are disabled by default. When website icons are disabled, the
FaviconDatabase
ofmanager
is closed and its reference removed, soget_favicon_database()
will returnNone
. If website icons are enabled again, a newFaviconDatabase
will be created.Added in version 2.40.
- Parameters:
enabled – value to set
Properties#
- class WebsiteDataManager