Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Review: Web Notification #3186

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarify deferral info
  • Loading branch information
peiche-jessica committed Jan 10, 2023
commit 8ef88d31c5b92e7b787c6f0dd7250ded2d25b4ef
8 changes: 8 additions & 0 deletions specs/WebNotification.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ typedef enum COREWEBVIEW2_TEXT_DIRECTION_KINDS {
interface ICoreWebView2Profile3 : IUnknown {
/// Add an event handler for the `NotificationReceived` event for persistent
/// notifications.
///
/// If a deferral is not taken on the event args, the subsequent scripts are
/// blocked until the event handler returns. If a deferral is taken, the
/// scripts are blocked until the deferral is completed.
HRESULT add_NotificationReceived(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sample for this or discussion about why no sample was needed (e.g. because it's identical to the CoreWebView2 version aside from where you register the handler).

Would an app want to treat persistent and non-persistent notifications differently?

Or is the reason that you subscribe to CoreWebView2.NotificationReceived to handle notifications raised by that specific WebView2, and you use CoreWebView2Profile.NotificationReceived for notifications not associated with any WebView2?

Do persistent notifications outlive the WebView2? (Why are they called "persistent"?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please add a third sample for this as we described elsewhere.

Please ensure we document the scope of persistent and non-persistent with respect to WebView2 (environment, profile, browser process, webview2)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between a profile notification and a webview notification?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment to explain a bit more and link to DOM documentation.

[in] ICoreWebView2ProfileNotificationReceivedEventHandler* eventHandler,
[out] EventRegistrationToken* token);
Expand All @@ -297,6 +301,10 @@ interface ICoreWebView2Profile3 : IUnknown {
interface ICoreWebView2_17 : ICoreWebView2_16 {
/// Add an event handler for the `NotificationReceived` event for
/// non-persistent notifications.
///
/// If a deferral is not taken on the event args, the subsequent scripts are
/// blocked until the event handler returns. If a deferral is taken, the
/// scripts are blocked until the deferral is completed.
HRESULT add_NotificationReceived(
[in] ICoreWebView2NotificationReceivedEventHandler* eventHandler,
[out] EventRegistrationToken* token);
Expand Down