Skip to content

Commit 0e6150e

Browse files
author
Maura Winstanley
committed
update idl
1 parent f0a5556 commit 0e6150e

1 file changed

Lines changed: 29 additions & 5 deletions

File tree

specs/LaunchingRegisteredProtocols.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ We are exposing an event that will fire when an attempt to launch a registered p
44

55
# Description
66

7-
This event will fire before the registered protocol launch occurs. Currently a popup dialog is displayed in which the user can click `Open` or `Cancel`. If the request is made from a trustworthy origin a checkmark box will be displayed that will allow the user to always allow this registered protocol from this origin.
7+
This event will fire before the registered protocol launch occurs. Currently a popup dialog is displayed in which the user can click `Open` or `Cancel`. If the request is made from a trustworthy origin a checkmark box will be displayed that will allow the user to always allow this registered protocol from this origin. The `NavigationStarting`, `NavigationCompleted, `SourceChanged`, `ContentLoading`, and `HistoryChanged` events will not fire when a request is made to launch a registered protocol.
88

99
There are two events associated with the registered protocol launch - one for the main frame, and one for non-main frame(s). In the case in which the launch request is made from a non-main frame, the frame will raise a `LaunchingRegisteredProtocol` event as well as `CoreWebView2.FrameLaunchingRegisteredProtocol` event.
1010
# Examples
@@ -113,7 +113,32 @@ See [API Details](#api-details) section below for API reference.
113113
## Win32 C++
114114

115115
```IDL
116-
/// This is the ICoreWebView2Frame3 interface.
116+
// This is the ICoreWebView2_11 interface.
117+
[uuid(cc39bea3-d6d8-471b-919f-da253e2fbf03), object, pointer_default(unique)]
118+
interface ICoreWebView2_11 : IUnknown {
119+
/// Add an event handler for the `RegisteredProtocol` event.
120+
/// The RegisteredProtocol event fires when a launch request is made to a protocol
121+
/// that is registered with the Windows OS. The host has the option to
122+
/// handle this event by suppressing the popup dialog that gives the user
123+
/// the option to allow the app launch as well as programatically cancel the
124+
/// app launch. The host also is given the opportunity to revoke previous permissions
125+
/// given to this origin and protocol to be launched automatically.
126+
/// The `NavigationStarting`, `NavigationCompleted, `SourceChanged`,
127+
/// `ContentLoading`, and `HistoryChanged` events will not fire, regardless
128+
/// of whether the `Cancel` or `Handled` property is set to `TRUE` or
129+
/// `FALSE`. This behavior holds true for the frame navigation events as
130+
/// well.
131+
HRESULT add_LaunchingRegisteredProtocol(
132+
[in] ICoreWebView2LaunchingRegisteredProtocolEventHandler* eventHandler,
133+
[out] EventRegistrationToken* token);
134+
135+
/// Remove an event handler previously added with
136+
/// `add_LaunchingRegisteredProtocol`.
137+
HRESULT remove_LaunchingRegisteredProtocol(
138+
[in] EventRegistrationToken token);
139+
}
140+
141+
// This is the ICoreWebView2Frame3 interface.
117142
[uuid(fe1d3718-fe8d-48ab-8594-9e3fff6755ac), object, pointer_default(unique)]
118143
interface ICoreWebView2Frame3 : IUnknown {
119144
/// Add an event handler for the `FrameRegisteredProtocol` event.
@@ -124,7 +149,7 @@ interface ICoreWebView2Frame3 : IUnknown {
124149
/// All of the event handlers share a common `LaunchingRegisteredProtocolEventArgs`
125150
/// object. Whichever event handler is last to change the
126151
/// `LaunchingRegisteredProtocolEventArgs.Cancel` property will
127-
/// decide if the frame launch registered protocol request will be cancelled.
152+
/// decide if the frame protocol request launch will be cancelled.
128153
/// Whichever event handler is last to change the
129154
/// `LaunchingRegisteredProtocolEventArgs.Handled` property will decide if
130155
/// the dialog will be suppressed. Whichever event handler is last to change the
@@ -167,8 +192,7 @@ interface ICoreWebView2LaunchingRegisteredProtocolEventArgs: IUnknown {
167192
[propget] HRESULT Uri([out, retval] LPWSTR* uri);
168193
169194
/// The host may set this flag to cancel the protocol launch. If set to
170-
/// `TRUE`, the protocol will not be launched, but the
171-
/// `NavigationCompleted` event will still fire. If cancelled, the
195+
/// `TRUE`, the protocol will not be launched. If cancelled, the
172196
/// dialog is not displayed regardless of the `Handled` property.
173197
174198
[propget] HRESULT Cancel([out, retval] BOOL* cancel);

0 commit comments

Comments
 (0)