You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/GetFavicon.md
+20-18Lines changed: 20 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,8 @@
1
1
# Background
2
-
A favicon (favorite icon) is a tiny icon included along with a website, which is displayed in places like the browser's address bar, page tabs and bookmarks menu. Developers would
3
-
like to have an API which allows them to retrieve the Favicon of a webpage, if it has been set, as well as get an update whenever the favicon has changed.
2
+
A favicon (favorite icon) is a tiny icon included along with a website, which is displayed in places like the browser's address bar, page tabs and bookmarks menu. Developers would like to have an API which allows them to retrieve the Favicon of a webpage, if it has been set, as well as get an update whenever the favicon has changed.
4
3
5
4
# Description
6
-
We propose a new Webview2 event which would allow developers to access the current Favicon of a page,
7
-
as well as be notified when the favicon changes. This means when a page first loads, it would raise
8
-
the FaviconChanged event since before parsing the HTML document there is no known favicon. DOM or JavaScript may change the Favicon,
9
-
causing the event to be raised again for the same document.
5
+
We propose a new Webview2 event which would allow developers to access the current Favicon of a page and be notified when the favicon changes. This means when a page first loads, it would raise the FaviconChanged event since before parsing the HTML document there is no known favicon. DOM or JavaScript may change the Favicon, causing the event to be raised again for the same document.
10
6
11
7
# Examples
12
8
## Win32 C++ Registering a listener for favicon changes
@@ -65,11 +61,13 @@ See [API Details](#api-details) Section below for API reference
65
61
## Win32 C++
66
62
```cpp
67
63
/// This interface is a handler for when the `Favicon` is changed.
68
-
/// The sender is the ICoreWebView2 object the top-level document of which has changed favicon and the eventArgs is nullptr. Use the FaviconUri property and GetFavicon method to obtain the favicon data.
69
-
/// second argument is null.
64
+
/// The sender is the ICoreWebView2 object the top-level document of
65
+
/// which has changed favicon and the eventArgs is nullptr. Use the
66
+
/// FaviconUri property and GetFavicon method to obtain the favicon
67
+
/// data. The second argument is always null.
70
68
/// For more information see `add_FaviconChanged`.
/// Called to notify the favicon has been retrieved.
86
84
HRESULT Invoke([in] HRESULT error_code);
87
85
}
88
86
89
87
/// This is the ICoreWebView2 Experimental Favicon interface.
90
-
/// The `FaviconChanged` event is raised when the [favicon](https://developer.mozilla.org/en-US/docs/Glossary/Favicon) of the top-level document changes. The favicon can change when navigating to a new document or if script dynamically changes the favicon. When navigating from a document with a favicon to a new URI, the FaviconChanged event will be raised first for first navigating to a new document which declares a favicon in its HTML or has script to set its favicon, the document and the FaviconChanged event will be raised for that
91
-
/// Favicon. When a new page loads event would fire due to Favicon not being set.
92
-
/// The event would also set the Favicon when the set by DOM or Javascript.
0 commit comments