[webkit-changes] [WebKit/WebKit] 643b0b: runtime.MessageSender origin parameter is inadvert...

Commit Queue noreply at github.com
Wed Feb 26 07:40:13 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 643b0bd007fb4de8eb20374ed128f243ac7c1431
      https://github.com/WebKit/WebKit/commit/643b0bd007fb4de8eb20374ed128f243ac7c1431
  Author: Elijah Sawyers <esawyers at apple.com>
  Date:   2025-02-26 (Wed, 26 Feb 2025)

  Changed paths:
    M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIPortCocoa.mm
    M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIRuntimeCocoa.mm
    M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIRuntime.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIRuntime.mm

  Log Message:
  -----------
  runtime.MessageSender origin parameter is inadvertently lowercased
https://bugs.webkit.org/show_bug.cgi?id=288511
rdar://140291738

Reviewed by Timothy Hatcher.

This patch fixes a bug where the runtime.MessageSender origin parameter would be
lowercased, which differs from the result returned from runtime.getURL.

To fix this, we can check if the origin is an extension origin, and if so,
maintain the case of the baseURL of the extension.

* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIPortCocoa.mm:
(WebKit::WebExtensionAPIPort::sender):
Pass in the extension's baseURL.

* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIRuntimeCocoa.mm:
(WebKit::toWebAPI):
Modify this method to maintain the case of the extension's baseURL, if the
origin is an extension origin.

(WebKit::WebExtensionContextProxy::internalDispatchRuntimeMessageEvent):
Pass in the extension's baseURL.

* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIRuntime.h:
Modify this method to take in the extension's baseURL.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIRuntime.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIRuntime, SendMessageFromOptionsPage)):
Write a new test to validate the change.

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