Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b933b3a6663a4bda0e2d96cfa7bbfb43a230dee7
https://github.com/WebKit/WebKit/commit/b933b3a6663a4bda0e2d96cfa7bbfb43a230dee7
Author: Elijah Sawyers <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
M
Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPINotificationsCocoa.mm
M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h
M Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in
M
Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPINotificationsCocoa.mm
M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPINotifications.h
M
Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPINotifications.idl
M Tools/TestWebKitAPI/Helpers/cocoa/TestWebExtensionsDelegate.h
M Tools/TestWebKitAPI/Helpers/cocoa/TestWebExtensionsDelegate.mm
M
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPINotifications.mm
Log Message:
-----------
Implement browser.notifications.update() for the web extension API
https://bugs.webkit.org/show_bug.cgi?id=325050
rdar://187615870
Reviewed by Brian Weinstein and Timothy Hatcher.
This patch implements browser.notifications.update(). The web process parses the
update options without requiring any keys and sends them to the UI process. The
provided fields are handed to the browser (through the delegate method) to
update
the existing notification. The promise resolves with a boolean whether a
matching
notification exists and was updated, and rejects when the browser reports an
internal error, such as the extension not being loaded or the delegate not
implementing the method.
This also reworks browser.notifications.create() to reject its promise when the
browser reports an internal error, instead of always resolving. In both cases,
WebKit commits the notification state only once the browser confirms the
operation succeeded.
Tests are included.
*
Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPINotificationsCocoa.mm:
(WebKit::mergeNotificationParameters):
(WebKit::WebExtensionContext::notificationsCreate):
(WebKit::WebExtensionContext::notificationsUpdate):
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in:
*
Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPINotificationsCocoa.mm:
(WebKit::parseNotificationOptions):
(WebKit::WebExtensionAPINotifications::createNotification):
(WebKit::WebExtensionAPINotifications::update):
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPINotifications.h:
*
Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPINotifications.idl:
* Tools/TestWebKitAPI/Helpers/cocoa/TestWebExtensionsDelegate.h:
* Tools/TestWebKitAPI/Helpers/cocoa/TestWebExtensionsDelegate.mm:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPINotifications.mm:
Canonical link: https://commits.webkit.org/322071@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications