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
- async clear(self, types: WebsiteDataTypes, timespan: int) bool#
This is the awaitable version of
clear().Added in version 2.16.
- Parameters:
types –
WebsiteDataTypestimespan – a
TimeSpan
- 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
typesmodified in the pasttimespan.If
timespanis 0, all website data will be removed.When the operation is finished,
callbackwill 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
timespanis nonzero. This behavior may change in the future.Added in version 2.16.
- Parameters:
types –
WebsiteDataTypestimespan – a
TimeSpancancellable – a
CancellableorNoneto ignorecallback – a
AsyncReadyCallbackto 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
- async fetch(self, types: WebsiteDataTypes) list[WebsiteData]#
This is the awaitable version of
fetch().Added in version 2.16.
- Parameters:
types –
WebsiteDataTypes
- 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
WebsiteDatafor the giventypes.When the operation is finished,
callbackwill be called. You can then callfetch_finish()to get the result of the operation.Added in version 2.16.
- Parameters:
types –
WebsiteDataTypescancellable – a
CancellableorNoneto ignorecallback – a
AsyncReadyCallbackto 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
FaviconDatabaseofmanager.Added in version 2.40.
- async get_itp_summary(self) list[ITPThirdParty]#
This is the awaitable version of
get_itp_summary().Added in version 2.30.
- 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
ITPThirdPartyseen formanager.Every
ITPThirdPartycontains the list ofITPFirstPartyunder which it has been seen.When the operation is finished,
callbackwill be called. You can then callget_itp_summary_finish()to get the result of the operation.Added in version 2.30.
- Parameters:
cancellable – a
CancellableorNoneto ignorecallback – a
AsyncReadyCallbackto 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
WebsiteDataManageris ephemeral.See
WebsiteDataManager:is-ephemeral for more details.Added in version 2.16.
- async remove(self, types: WebsiteDataTypes, website_data: list[WebsiteData]) bool#
This is the awaitable version of
remove().Added in version 2.16.
- Parameters:
types –
WebsiteDataTypeswebsite_data – a
ListofWebsiteData
- 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_datalist.Asynchronously removes the website data of the given
typesfor websites in the givenwebsite_datalist. Useclear()if you want to remove the website data for all sites.When the operation is finished,
callbackwill be called. You can then callremove_finish()to get the result of the operation.Added in version 2.16.
- Parameters:
types –
WebsiteDataTypeswebsite_data – a
ListofWebsiteDatacancellable – a
CancellableorNoneto ignorecallback – a
AsyncReadyCallbackto 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
FaviconDatabaseofmanageris closed and its reference removed, soget_favicon_database()will returnNone. If website icons are enabled again, a newFaviconDatabasewill be created.Added in version 2.40.
- Parameters:
enabled – value to set
Properties#
- class WebsiteDataManager