-
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.
Clear activeTab and action tab customization when tab navigates.
https://webkit.org/b/263918 rdar://problem/117704349 Reviewed by Brian Weinstein. Moves the webNavigation load events to WebExtensionContext, since more things will need to tie into these hooks. Fixes injected style removal when webPageID is used, so it only removes the styles when the page they apply to is navigated. Also this was incorrectly behind the webNavigation permission checks before, when it needs to always happen. Properly clears the activeTb permission on tab navigation, and fires the onUpdated events for URL and Title when activeTab comes and goes, as well as any pattern grant. This matches what Safari currently does when permissions are granted. Clears the action customizations if the tab navigates. This matches the other browsers and what Safari currently does. Fixes the match pattern notifications to use the right constant. * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm: (WebKit::WebExtensionAction::clearCustomizations): (WebKit::WebExtensionAction::setPopupPath): (WebKit::WebExtensionAction::setLabel): (WebKit::WebExtensionAction::setBadgeText): (WebKit::WebExtensionAction::setEnabled): * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm: (WebKit::WebExtensionContext::postAsyncNotification): (WebKit::WebExtensionContext::grantPermissionMatchPatterns): (WebKit::WebExtensionContext::denyPermissionMatchPatterns): (WebKit::WebExtensionContext::removeGrantedPermissionMatchPatterns): (WebKit::WebExtensionContext::removeDeniedPermissionMatchPatterns): (WebKit::WebExtensionContext::permissionState): (WebKit::WebExtensionContext::setPermissionState): (WebKit::WebExtensionContext::didChangeTabProperties): (WebKit::WebExtensionContext::didStartProvisionalLoadForFrame): (WebKit::WebExtensionContext::didCommitLoadForFrame): (WebKit::WebExtensionContext::didFinishLoadForFrame): (WebKit::WebExtensionContext::didFailLoadForFrame): (WebKit::WebExtensionContext::performAction): (WebKit::WebExtensionContext::performCommand): (WebKit::WebExtensionContext::userGesturePerformed): (WebKit::WebExtensionContext::hasActiveUserGesture const): (WebKit::WebExtensionContext::clearUserGesture): (WebKit::WebExtensionContext::loadBackgroundPageListenersFromStorage): (WebKit::WebExtensionContext::saveBackgroundPageListenersToStorage): (WebKit::WebExtensionContext::removeInjectedContent): * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerCocoa.mm: (WebKit::WebExtensionController::didStartProvisionalLoadForFrame): (WebKit::WebExtensionController::didCommitLoadForFrame): (WebKit::WebExtensionController::didFinishLoadForFrame): (WebKit::WebExtensionController::didFailLoadForFrame): * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionTabCocoa.mm: (WebKit::WebExtensionTab::changedParameters const): * Source/WebKit/UIProcess/Extensions/WebExtensionAction.h: * Source/WebKit/UIProcess/Extensions/WebExtensionContext.h: (WebKit::WebExtensionContext::didChangeTabProperties): * Source/WebKit/UIProcess/Extensions/WebExtensionController.h: * Source/WebKit/UIProcess/Extensions/WebExtensionTab.h: (WebKit::WebExtensionTab::changedParameters): (WebKit::WebExtensionTab::hasActiveUserGesture): (WebKit::WebExtensionTab::setActiveUserGesture): (WebKit::WebExtensionTab::temporaryPermissionMatchPattern): (WebKit::WebExtensionTab::setTemporaryPermissionMatchPattern): (WebKit::WebExtensionTab::changedProperties const): (WebKit::WebExtensionTab::addChangedProperties): (WebKit::WebExtensionTab::clearChangedProperties): * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAction.mm: (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm: (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.mm: (-[TestWebExtensionTab webView:didCommitNavigation:]): Canonical link: https://commits.webkit.org/270722@main
- Loading branch information
Showing
11 changed files
with
470 additions
and
162 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
260 changes: 194 additions & 66 deletions
260
Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
Large diffs are not rendered by default.
Oops, something went wrong.
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.