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[[Object | None, AsyncResult, Any], None] | None = None, user_data: 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 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#

The type of the None singleton.

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

  • favicon_uri – the URI of the favicon