-
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.
Cherry-pick 5e245ad. rdar://123407828
Allow tabs.update to be called without a tabID https://bugs.webkit.org/show_bug.cgi?id=269934 rdar://123407828 Reviewed by Timothy Hatcher. The tabID is an optional argument to tabs.update. We were always attempting to get the value of the optional. If it isn't passed, then it is meant to fall back to the active tab of the current context, which means: - If this was called from a popup, then the active tab of the popup's window - If this was called from the background page, then the active tab of the active window This required some refactoring to WebExtensionContext::getTab and WebExtensionContext::getCurrentTab to support this, and some tests were added calling this method without a tab ID from both contexts. * Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPITabsCocoa.mm: (WebKit::WebExtensionContext::tabsUpdate): (WebKit::WebExtensionContext::tabsReload): (WebKit::WebExtensionContext::tabsGoBack): (WebKit::WebExtensionContext::tabsGoForward): (WebKit::WebExtensionContext::tabsDetectLanguage): (WebKit::WebExtensionContext::tabsToggleReaderMode): (WebKit::WebExtensionContext::tabsGetZoom): (WebKit::WebExtensionContext::tabsSetZoom): (WebKit::WebExtensionContext::tabsExecuteScript): (WebKit::WebExtensionContext::tabsInsertCSS): (WebKit::WebExtensionContext::tabsRemoveCSS): * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm: (WebKit::WebExtensionContext::getWindow const): (WebKit::WebExtensionContext::getTab const): (WebKit::WebExtensionContext::getCurrentTab const): * Source/WebKit/UIProcess/Extensions/WebExtensionContext.h: * Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in: * Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPITabsCocoa.mm: (WebKit::WebExtensionAPITabs::update): * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAction.mm: (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/275204@main Identifier: 274471.485@safari-7619.1.5-branch
- Loading branch information
1 parent
7b50310
commit 3e55164
Showing
7 changed files
with
126 additions
and
73 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