[webkit-changes] [WebKit/WebKit] bab9c3: clipboardWrite permission does not work in Web Ext...
Timothy Hatcher
noreply at github.com
Mon Mar 4 10:42:22 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bab9c3e3b0ebd24d87c99a17d979bc2b8c7cd715
https://github.com/WebKit/WebKit/commit/bab9c3e3b0ebd24d87c99a17d979bc2b8c7cd715
Author: Timothy Hatcher <timothy at apple.com>
Date: 2024-03-04 (Mon, 04 Mar 2024)
Changed paths:
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIPermissions.mm
Log Message:
-----------
clipboardWrite permission does not work in Web Extensions.
https://webkit.org/b/270419
rdar://123976956
Reviewed by Brian Weinstein.
Set the javaScriptCanAccessClipboard preference when the clipboardWrite permission
is granted or is revoked. Added three new tests to verify this works.
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::permissionsDidChange): Added.
(WebKit::WebExtensionContext::postAsyncNotification): Call permissionsDidChange().
(WebKit::WebExtensionContext::enumerateExtensionPages): Added.
(WebKit::WebExtensionContext::relatedWebView): Use enumerateExtensionPages().
(WebKit::WebExtensionContext::webViewConfiguration): Set _javaScriptCanAccessClipboard
based on the clipboardWrite permission.
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIPermissions.mm:
(TestWebKitAPI::runScriptWithUserGesture): Added ASSERT.
(TEST(WKWebExtensionAPIPermissions, ClipboardWrite)): Added.
(TEST(WKWebExtensionAPIPermissions, ClipboardWriteWithoutPermission)): Added.
(TEST(WKWebExtensionAPIPermissions, ClipboardWriteWithRequest)): Added.
Canonical link: https://commits.webkit.org/275639@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list