FaviconDatabase

class FaviconDatabase(**properties: Any)

Superclasses: Object

Provides access to the icons associated with web sites.

WebKit will automatically look for available icons in <link> 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 Settings:enable-private-browsing is 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

class FaviconDatabase
clear() None

Clears all icons from the database.

get_favicon(page_uri: str, cancellable: Cancellable | None = None, callback: Callable[[...], None] | None = None, *user_data: Any) 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 get_favicon_finish() to get the result of the operation.

Parameters:
  • page_uri – URI of the page for which we want to retrieve the favicon

  • cancellable – A Cancellable or None.

  • callback – A AsyncReadyCallback to call when the request is satisfied or None if you don’t care about the result.

  • user_data – The data to pass to callback.

get_favicon_finish(result: AsyncResult) Texture

Finishes an operation started with get_favicon().

Parameters:

result – A AsyncResult obtained from the AsyncReadyCallback passed to get_favicon()

get_favicon_uri(page_uri: str) str

Obtains the URI of the favicon for the given page_uri.

Parameters:

page_uri – URI of the page containing the icon

Signals

class FaviconDatabase.signals
favicon_changed(page_uri: str, favicon_uri: str) None

This signal is emitted when the favicon URI of page_uri has been changed to favicon_uri in the database. You can connect to this signal and call get_favicon() to get the favicon. If you are interested in the favicon of a WebView it’s easier to use the WebView:favicon property. See get_favicon() for more details.

Parameters:
  • page_uri – the URI of the Web page containing the icon

  • favicon_uri – the URI of the favicon