:right-sidebar: True
FaviconDatabase
===================================================================
.. currentmodule:: gi.repository.WebKit
.. class:: FaviconDatabase(**properties: ~typing.Any)
:no-contents-entry:
Superclasses: :class:`~gi.repository.GObject.Object`
Provides access to the icons associated with web sites.
WebKit will automatically look for available icons in
elements on opened pages as well as an existing favicon.ico and
load the images found into a memory cache if possible. That cache
is frozen to an on-disk database for persistence.
If :obj:`~gi.repository.WebKit.Settings`\:enable-private-browsing is :const:`True`, new icons
won't be added to the on-disk database and no existing icons will
be deleted from it. Nevertheless, WebKit will still store them in
the in-memory cache during the current execution.
Methods
-------
.. rst-class:: interim-class
.. class:: FaviconDatabase
:no-index:
.. method:: clear() -> None
Clears all icons from the database.
.. method:: get_favicon(self, page_uri: str) -> ~gi.repository.Gdk.Texture
:async:
This is the `awaitable `_ version of :meth:`get_favicon`.
:param page_uri: URI of the page for which we want to retrieve the favicon
.. method:: get_favicon(page_uri: str, 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 obtains a favicon image.
Asynchronously obtains an image of the favicon for the
given page URI. It returns the cached icon if it's in the database
asynchronously waiting for the icon to be read from the database.
This is an asynchronous method. When the operation is finished, callback will
be invoked. You can then call :func:`~gi.repository.WebKit.FaviconDatabase.get_favicon_finish`
to get the result of the operation.
:param page_uri: URI of the page for which we want to retrieve the favicon
:param cancellable: A :obj:`~gi.repository.Gio.Cancellable` or :const:`None`.
:param callback: A :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is
satisfied or :const:`None` if you don't care about the result.
:param user_data: The data to pass to ``callback``\.
.. method:: get_favicon_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.Gdk.Texture
Finishes an operation started with :func:`~gi.repository.WebKit.FaviconDatabase.get_favicon`.
:param result: A :obj:`~gi.repository.Gio.AsyncResult` obtained from the :obj:`~gi.repository.Gio.AsyncReadyCallback` passed to :func:`~gi.repository.WebKit.FaviconDatabase.get_favicon`
.. method:: get_favicon_uri(page_uri: str) -> str
Obtains the URI of the favicon for the given ``page_uri``\.
:param page_uri: URI of the page containing the icon
Signals
-------
.. rst-class:: interim-class
.. class:: FaviconDatabase.signals
:no-index:
.. method:: favicon_changed(page_uri: str, favicon_uri: str) -> None
The type of the None singleton.
:param page_uri: the URI of the Web page containing the icon
:param favicon_uri: the URI of the favicon