[webkit-changes] [WebKit/WebKit] bb3551: Web Extensions: tabs.executeScript ignores frameId...
Timothy Hatcher
noreply at github.com
Wed Oct 9 12:58:55 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bb35511a78052fe3bc87e2293c1b3ce12bc8e626
https://github.com/WebKit/WebKit/commit/bb35511a78052fe3bc87e2293c1b3ce12bc8e626
Author: Timothy Hatcher <timothy at apple.com>
Date: 2024-10-09 (Wed, 09 Oct 2024)
Changed paths:
M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIScriptingCocoa.mm
M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPITabsCocoa.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIScripting.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm
Log Message:
-----------
Web Extensions: tabs.executeScript ignores frameId parameter.
https://webkit.org/b/281099
rdar://137449521
Reviewed by Brian Weinstein.
The parsing of options for `tabs.executeScript` was overriding the `frameIdentifier`
with the main frame since the check for all frames was always returning `true` if
the `allFrames` option was missing or `false`.
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIScriptingCocoa.mm:
(WebKit::WebExtensionAPIScripting::parseTargetInjectionOptions): Remove early return
and add `allFrames` else case.
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPITabsCocoa.mm:
(WebKit::WebExtensionAPITabs::parseScriptOptions): Make `allFrames` be the else case.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIScripting.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIScripting, ExecuteScriptWithFrameIds)): Replaced
with a better test that uses pathname to verify the frame is the target.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPITabs, ExecuteScriptWithFrameId)): Added.
Canonical link: https://commits.webkit.org/284915@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