[webkit-changes] [WebKit/WebKit] 7f5657: Web Extensions do not replace @@extension_id in CS...

Timothy Hatcher noreply at github.com
Wed Sep 11 18:49:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7f56575f47fc93f91da4aaf9ee281f99319733cb
      https://github.com/WebKit/WebKit/commit/7f56575f47fc93f91da4aaf9ee281f99319733cb
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-09-11 (Wed, 11 Sep 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionURLSchemeHandlerCocoa.mm
    M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPILocalization.mm

  Log Message:
  -----------
  Web Extensions do not replace @@extension_id in CSS resources.
https://webkit.org/b/279546
rdar://135814395

Reviewed by Jeff Miller and Brian Weinstein.

Have `WebExtensionContext` contain a copy of the localization for CSS resources.

The `WebExtension` localization cannot hold the extension identifier since each context has its own
identifier, derived from the base URL. We previously addressed this for `WebExtensionContextProxy`
in the WebProcess, but missed doing so for CSS resources in the UI process.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::localization): Added.
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionURLSchemeHandlerCocoa.mm:
(WebKit::WebExtensionURLSchemeHandler::platformStartTask): Use the localization from the extension context.
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPILocalization.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPILocalization, CSSLocalization)): Added.

Canonical link: https://commits.webkit.org/283522@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