WebKit.FaviconDatabase

g GObject.Object GObject.Object WebKit.FaviconDatabase WebKit.FaviconDatabase GObject.Object->WebKit.FaviconDatabase

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

clear ()

get_favicon (page_uri, cancellable, callback, *user_data)

get_favicon_finish (result)

get_favicon_uri (page_uri)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

favicon-changed

This signal is emitted when the favicon URI of page_uri has been changed to favicon_uri in the database.

Fields

Inherited:

GObject.Object (1)

Class Details

class WebKit.FaviconDatabase(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit.FaviconDatabaseClass

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 WebKit.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.

clear()

Clears all icons from the database.

get_favicon(page_uri, cancellable, callback, *user_data)
Parameters:

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 WebKit.FaviconDatabase.get_favicon_finish() to get the result of the operation.

get_favicon_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to WebKit.FaviconDatabase.get_favicon()

Raises:

GLib.Error

Returns:

a new favicon image, or None in case of error.

Return type:

Gdk.Texture

Finishes an operation started with WebKit.FaviconDatabase.get_favicon().

get_favicon_uri(page_uri)
Parameters:

page_uri (str) – URI of the page containing the icon

Returns:

a newly allocated URI for the favicon, or None if the database doesn’t have a favicon for page_uri.

Return type:

str

Obtains the URI of the favicon for the given page_uri.

Signal Details

WebKit.FaviconDatabase.signals.favicon_changed(favicon_database, page_uri, favicon_uri)
Signal Name:

favicon-changed

Flags:

RUN_LAST

Parameters:
  • favicon_database (WebKit.FaviconDatabase) – The object which received the signal

  • page_uri (str) – the URI of the Web page containing the icon

  • favicon_uri (str) – the URI of the favicon

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 WebKit.FaviconDatabase.get_favicon() to get the favicon. If you are interested in the favicon of a WebKit.WebView it’s easier to use the WebKit.WebView :favicon property. See WebKit.WebView.get_favicon() for more details.