Skip to content

Commit 98988ab

Browse files
authored
Clarified what happened when there is no fav icon on the page
1 parent d301c54 commit 98988ab

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

specs/GetFavicon.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ webView.CoreWebView2.FaviconChanged += (CoreWebView2 sender, Object arg) =>
5454
};
5555
```
5656
# API Notes
57-
If a Web page does not have a Favicon, then the event is only fires when the
58-
page is navigated to. The Favicon would be an empty image and Uri. The
59-
user is expected to handle this scenario.
57+
If a Web page does not have a Favicon, then the FaviconChanged event
58+
is fired when the page is navigated to. The Favicon would be an
59+
empty image and empty Uri. The user is expected to handle this scenario.
60+
Otherwise we fire the FaviconChanged with an observed change to the
61+
Favicon. In that scenario, we would provide the Uri of the Favicon we
62+
observed and a copy of the image.
6063
See [API Details](#api-details) Section below for API reference
6164
# API Details
6265
## Win32 C++
@@ -98,16 +101,17 @@ interface ICoreWebView2_10 : ICoreWebView2_9 {
98101
HRESULT remove_FaviconChanged(
99102
[in] EventRegistrationToken token);
100103

101-
/// Get the current Uri of the favicon.
104+
/// Get the current Uri of the favicon as a string.
102105
/// If value is null, the `HRESULT` `E_POINTER`, otherwise it is `S_OK`.
103106
/// If a page has no favicon then value is an empty string.
104107
[propget] HRESULT FaviconUri([out, retval] LPWSTR* value);
105108

106109
/// Async function for getting the actual image data of the favicon.
107110
/// If the `imageStream` is null, the `HRESULT` will be `E_POINTER`, otherwise
108111
/// it is `S_OK`.
109-
/// The image is copied to the `imageStream` object and when complete,
110-
/// it will execute the `eventHandler` if it was set.
112+
/// The image is copied to the `imageStream` object and when complete. If
113+
/// there is no image then no data would be copied into the imageStream.
114+
/// In either scenario the `eventHandler` is executed at the end of the operation.
111115
HRESULT GetFavicon(
112116
[in] COREWEBVIEW2_FAVICON_IMAGE_FORMAT format,
113117
[in] IStream* imageStream,

0 commit comments

Comments
 (0)