-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for browser.tabs script APIs.
https://bugs.webkit.org/show_bug.cgi?id=262816 Reviewed by Timothy Hatcher. This patch implements the tabs.executeScript(), tabs.insertCSS(), and tabs.removeCSS() APIs. Testing: - Calls to methods with an invalid tab results in an error. - A result is returned from for each frame for scripting.executeScript(). - Injections execute in the top frame only if allFrames isn't specified or is false. Will add more extensive tests in a follow up PR. * Source/WebKit/Shared/Extensions/WebExtensionDynamicScripts.serialization.in: * Source/WebKit/Shared/Extensions/WebExtensionScriptInjectionParameters.h: * Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPITabsCocoa.mm: (WebKit::WebExtensionContext::tabsExecuteScript): (WebKit::WebExtensionContext::tabsInsertCSS): (WebKit::WebExtensionContext::tabsRemoveCSS): * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionDynamicScriptsCocoa.mm: (WebKit::WebExtensionDynamicScripts::toInjectionResultParameters): * Source/WebKit/UIProcess/Extensions/WebExtensionContext.h: * Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in: * Source/WebKit/UIProcess/Extensions/WebExtensionDynamicScripts.h: (WebKit::WebExtensionDynamicScripts::InjectionResultHolder::create): (WebKit::WebExtensionDynamicScripts::InjectionResultHolder::InjectionResultHolder): Created a ref counted class to hold the results of the script injections so that the data is still valid when the callback aggregator is called. * Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPITabsCocoa.mm: (WebKit::toWebAPI): (WebKit::WebExtensionAPITabs::parseScriptOptions): (WebKit::WebExtensionAPITabs::executeScript): (WebKit::WebExtensionAPITabs::insertCSS): (WebKit::WebExtensionAPITabs::removeCSS): * Source/WebKit/WebProcess/Extensions/API/WebExtensionAPITabs.h: * Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPITabs.idl: Canonical link: https://commits.webkit.org/269028@main
- Loading branch information
1 parent
4a0b130
commit ea26ecd
Showing
10 changed files
with
307 additions
and
6 deletions.
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
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
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
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
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
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
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
Oops, something went wrong.