WebKit2.FaviconDatabase¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when the favicon URI of page_uri has been changed to favicon_uri in the database. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class WebKit2.FaviconDatabase(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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
WebKit2.Settings
:enable-private-browsing
isTrue
, 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:
page_uri (
str
) – URI of the page for which we want to retrieve the faviconcancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – AGio.AsyncReadyCallback
to call when the request is satisfied orNone
if you don’t care about the result.
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
WebKit2.FaviconDatabase.get_favicon_finish
() to get the result of the operation.
- get_favicon_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
obtained from theGio.AsyncReadyCallback
passed toWebKit2.FaviconDatabase.get_favicon
()- Raises:
- Returns:
a new favicon image, or
None
in case of error.- Return type:
Finishes an operation started with
WebKit2.FaviconDatabase.get_favicon
().
Signal Details¶
- WebKit2.FaviconDatabase.signals.favicon_changed(favicon_database, page_uri, favicon_uri)¶
- Signal Name:
favicon-changed
- Flags:
- Parameters:
favicon_database (
WebKit2.FaviconDatabase
) – The object which received the signalpage_uri (
str
) – the URI of the Web page containing the iconfavicon_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
WebKit2.FaviconDatabase.get_favicon
() to get the favicon. If you are interested in the favicon of aWebKit2.WebView
it’s easier to use theWebKit2.WebView
:favicon
property. SeeWebKit2.WebView.get_favicon
() for more details.