interface ICoreWebView2Experimental12
Note
This reference is no longer being maintained. For the latest API reference, see WebView2 API Reference.
Note
This an experimental API that is shipped with our prerelease SDK. See WebView2 release notes.
interface ICoreWebView2Experimental12
: public IUnknown
This interface is an extension of ICoreWebView2Experimental12 that support Favicons.
Summary
Members | Descriptions |
---|---|
add_FaviconChanged | Add an event handler for the FaviconChanged event. |
get_FaviconUri | Get the current Uri of the favicon as a string. |
GetFavicon | Async function for getting the actual image data of the favicon. |
remove_FaviconChanged | Remove the event handler for FaviconChanged event. |
Applies to
Product | Introduced |
---|---|
WebView2 Win32 | N/A |
WebView2 Win32 Prerelease | 1.0.1222 |
Members
add_FaviconChanged
Add an event handler for the FaviconChanged
event.
public HRESULT add_FaviconChanged(ICoreWebView2ExperimentalFaviconChangedEventHandler * eventHandler, EventRegistrationToken * token)
The FaviconChanged
event is raised when the favicon had a different URL then the previous URL. The FaviconChanged event will be raised for first navigating to a new document, whether or not a document declares a Favicon in HTML if the favicon is different from the previous fav icon. The event will be raised again if a favicon is declared in its HTML or has script to set its favicon. The favicon information can then be retrieved with GetFavicon
and FaviconUri
.
get_FaviconUri
Get the current Uri of the favicon as a string.
public HRESULT get_FaviconUri(LPWSTR * value)
If the value is null, then the return value is E_POINTER
, otherwise it is S_OK
. If a page has no favicon then the value is an empty string.
The caller must free the returned string with CoTaskMemFree
. See API Conventions.
GetFavicon
Async function for getting the actual image data of the favicon.
public HRESULT GetFavicon(COREWEBVIEW2_FAVICON_IMAGE_FORMAT format, ICoreWebView2ExperimentalGetFaviconCompletedHandler * completedHandler)
The image is copied to the imageStream
object in ICoreWebView2GetFaviconCompletedHandler
. If there is no image then no data would be copied into the imageStream. The format
is the file format to return the image stream. completedHandler
is executed at the end of the operation.
remove_FaviconChanged
Remove the event handler for FaviconChanged
event.
public HRESULT remove_FaviconChanged(EventRegistrationToken token)