-
Notifications
You must be signed in to change notification settings - Fork 55
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
peiche-jessica
wants to merge
18
commits into
main
Choose a base branch
from
api-notification
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1c1d3d0
Add Web Notification API Spec draft
peiche-jessica 952a757
Apply suggestions from code review
peiche-jessica e03a214
Address initial feedback part 1
peiche-jessica cbd9d61
Add enum CoreWebView2TextDirectionKinds to c# API details
peiche-jessica 5e22e5f
Report* and CloseRequested
peiche-jessica 0b9a618
Persistent -> ProfileNotificationReceivedEventHandler
peiche-jessica 61d7ae7
Address initial feedback part 2
peiche-jessica c61f653
Update ref doc
peiche-jessica b8395cb
Add DataAsJson and TryGetDataAsString
peiche-jessica 88418d0
Add links to Notification.actions
peiche-jessica 0b6a3aa
Apply API name suggestion
peiche-jessica 25207b4
Clarify Handled and ReportXXX methods
peiche-jessica 8ef88d3
Clarify deferral info
peiche-jessica 4908aaf
Fix sample code
peiche-jessica 993fe9f
Make ReportClicked and ReportClosed async
peiche-jessica 320baf0
Address feedback
peiche-jessica 16ba2bc
Update sample
peiche-jessica 4493c00
Merge pull request #3049 from MicrosoftEdge/api-notification-draft
peiche-jessica File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Clarify deferral info
- Loading branch information
commit 8ef88d31c5b92e7b787c6f0dd7250ded2d25b4ef
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the difference between a profile notification and a webview notification? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
@@ -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); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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"?)
There was a problem hiding this comment.
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)