:right-sidebar: True WebsiteDataManager =================================================================== .. currentmodule:: gi.repository.WebKit .. versionadded:: 2.10 .. class:: WebsiteDataManager(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Manages data stored locally by web sites. You can use WebKitWebsiteDataManager to configure the local directories where website data will be stored. Use :obj:`~gi.repository.WebKit.WebsiteDataManager`\:base-data-directory and :obj:`~gi.repository.WebKit.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 ------- .. rst-class:: interim-class .. class:: WebsiteDataManager :no-index: .. method:: clear(types: ~gi.repository.WebKit.WebsiteDataTypes, timespan: int, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None 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 :func:`~gi.repository.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. .. versionadded:: 2.16 :param types: :obj:`~gi.repository.WebKit.WebsiteDataTypes` :param timespan: a :obj:`~gi.repository.GLib.TimeSpan` :param cancellable: a :obj:`~gi.repository.Gio.Cancellable` or :const:`None` to ignore :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is satisfied :param user_data: the data to pass to callback function .. method:: clear_finish(result: ~gi.repository.Gio.AsyncResult) -> bool Finish an asynchronous operation started with :func:`~gi.repository.WebKit.WebsiteDataManager.clear` .. versionadded:: 2.16 :param result: a :obj:`~gi.repository.Gio.AsyncResult` .. method:: fetch(types: ~gi.repository.WebKit.WebsiteDataTypes, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Asynchronously get the list of :obj:`~gi.repository.WebKit.WebsiteData` for the given ``types``\. When the operation is finished, ``callback`` will be called. You can then call :func:`~gi.repository.WebKit.WebsiteDataManager.fetch_finish` to get the result of the operation. .. versionadded:: 2.16 :param types: :obj:`~gi.repository.WebKit.WebsiteDataTypes` :param cancellable: a :obj:`~gi.repository.Gio.Cancellable` or :const:`None` to ignore :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is satisfied :param user_data: the data to pass to callback function .. method:: fetch_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.WebKit.WebsiteData] Finish an asynchronous operation started with :func:`~gi.repository.WebKit.WebsiteDataManager.fetch`. .. versionadded:: 2.16 :param result: a :obj:`~gi.repository.Gio.AsyncResult` .. method:: get_base_cache_directory() -> str | None Get the :obj:`~gi.repository.WebKit.WebsiteDataManager`\:base-cache-directory property. .. versionadded:: 2.10 .. method:: get_base_data_directory() -> str | None Get the :obj:`~gi.repository.WebKit.WebsiteDataManager`\:base-data-directory property. .. versionadded:: 2.10 .. method:: get_favicon_database() -> ~gi.repository.WebKit.FaviconDatabase | None Get the :obj:`~gi.repository.WebKit.FaviconDatabase` of ``manager``\. .. versionadded:: 2.40 .. method:: get_favicons_enabled() -> bool Get whether website icons are enabled. .. versionadded:: 2.40 .. method:: get_itp_summary(cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.Any = None) -> None Asynchronously get the list of :obj:`~gi.repository.WebKit.ITPThirdParty` seen for ``manager``\. Every :obj:`~gi.repository.WebKit.ITPThirdParty` contains the list of :obj:`~gi.repository.WebKit.ITPFirstParty` under which it has been seen. When the operation is finished, ``callback`` will be called. You can then call :func:`~gi.repository.WebKit.WebsiteDataManager.get_itp_summary_finish` to get the result of the operation. .. versionadded:: 2.30 :param cancellable: a :obj:`~gi.repository.Gio.Cancellable` or :const:`None` to ignore :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is satisfied :param user_data: the data to pass to callback function .. method:: get_itp_summary_finish(result: ~gi.repository.Gio.AsyncResult) -> list[~gi.repository.WebKit.ITPThirdParty] Finish an asynchronous operation started with :func:`~gi.repository.WebKit.WebsiteDataManager.get_itp_summary`. .. versionadded:: 2.30 :param result: a :obj:`~gi.repository.Gio.AsyncResult` .. method:: is_ephemeral() -> bool Get whether a :obj:`~gi.repository.WebKit.WebsiteDataManager` is ephemeral. See :obj:`~gi.repository.WebKit.WebsiteDataManager`\:is-ephemeral for more details. .. versionadded:: 2.16 .. method:: remove(types: ~gi.repository.WebKit.WebsiteDataTypes, website_data: list[~gi.repository.WebKit.WebsiteData], cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[~gi.repository.GObject.Object | None, ~gi.repository.Gio.AsyncResult, ~typing.Any], None] | None = None, user_data: ~typing.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 given ``website_data`` list. Use :func:`~gi.repository.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 :func:`~gi.repository.WebKit.WebsiteDataManager.remove_finish` to get the result of the operation. .. versionadded:: 2.16 :param types: :obj:`~gi.repository.WebKit.WebsiteDataTypes` :param website_data: a :obj:`~gi.repository.GLib.List` of :obj:`~gi.repository.WebKit.WebsiteData` :param cancellable: a :obj:`~gi.repository.Gio.Cancellable` or :const:`None` to ignore :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is satisfied :param user_data: the data to pass to callback function .. method:: remove_finish(result: ~gi.repository.Gio.AsyncResult) -> bool Finish an asynchronous operation started with :func:`~gi.repository.WebKit.WebsiteDataManager.remove`. .. versionadded:: 2.16 :param result: a :obj:`~gi.repository.Gio.AsyncResult` .. method:: set_favicons_enabled(enabled: bool) -> None Set whether website icons are enabled. Website icons are disabled by default. When website icons are disabled, the :obj:`~gi.repository.WebKit.FaviconDatabase` of ``manager`` is closed and its reference removed, so :func:`~gi.repository.WebKit.WebsiteDataManager.get_favicon_database` will return :const:`None`. If website icons are enabled again, a new :obj:`~gi.repository.WebKit.FaviconDatabase` will be created. .. versionadded:: 2.40 :param enabled: value to set Properties ---------- .. rst-class:: interim-class .. class:: WebsiteDataManager :no-index: .. attribute:: props.base_cache_directory :type: str The type of the None singleton. .. versionadded:: 2.10 .. attribute:: props.base_data_directory :type: str The type of the None singleton. .. versionadded:: 2.10 .. attribute:: props.is_ephemeral :type: bool The type of the None singleton. .. versionadded:: 2.16 .. attribute:: props.origin_storage_ratio :type: float The type of the None singleton. .. versionadded:: 2.42 .. attribute:: props.total_storage_ratio :type: float The type of the None singleton. .. versionadded:: 2.42