[webkit-changes] [WebKit/WebKit] 785a4e: [GTK] Create WebKitWebExtension

Jamie Murphy noreply at github.com
Mon Feb 24 10:16:05 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 785a4e3b033dd4e0c483fa961891d1e461123ff1
      https://github.com/WebKit/WebKit/commit/785a4e3b033dd4e0c483fa961891d1e461123ff1
  Author: Jamie <hello at itsjamie.dev>
  Date:   2025-02-24 (Mon, 24 Feb 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/Icon.h
    M Source/WebCore/platform/graphics/gtk/IconGtk.cpp
    M Source/WebKit/PlatformGTK.cmake
    M Source/WebKit/Shared/API/APIData.h
    A Source/WebKit/Shared/Extensions/gtk/WebExtensionUtilitiesGtk.cpp
    M Source/WebKit/SourcesGTK.txt
    M Source/WebKit/UIProcess/API/glib/WebKitError.cpp
    M Source/WebKit/UIProcess/API/glib/WebKitError.h.in
    M Source/WebKit/UIProcess/API/glib/WebKitPrivate.cpp
    M Source/WebKit/UIProcess/API/glib/WebKitPrivate.h
    A Source/WebKit/UIProcess/API/glib/WebKitWebExtension.cpp
    A Source/WebKit/UIProcess/API/glib/WebKitWebExtension.h.in
    A Source/WebKit/UIProcess/API/glib/WebKitWebExtensionInternal.h
    M Source/WebKit/UIProcess/API/glib/webkit.h.in
    M Source/WebKit/UIProcess/Extensions/WebExtension.h
    A Source/WebKit/UIProcess/Extensions/gtk/WebExtensionGtk.cpp
    A Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebExtension.cpp
    M Tools/TestWebKitAPI/glib/CMakeLists.txt
    A Tools/TestWebKitAPI/glib/WebKitGLib/WebExtensionUtilities.cpp
    A Tools/TestWebKitAPI/glib/WebKitGLib/WebExtensionUtilities.h

  Log Message:
  -----------
  [GTK] Create WebKitWebExtension
https://webkit.org/b/285379

Reviewed by Adrian Perez de Castro and Michael Catanzaro.

This creates a GLib API of WebExtension, along with some utility functions needed for Linux-specific pathways.

* Source/WebKit/PlatformGTK.cmake:
* Source/WebKit/Shared/Extensions/glib/WebExtensionUtilitiesGlib.cpp: Copied from Source/WebKit/UIProcess/API/glib/WebKitPrivate.h.
(WebKit::availableScreenScales):
* Source/WebKit/SourcesGTK.txt:
* Source/WebKit/UIProcess/API/glib/WebKitError.cpp:
(webkit_web_extension_error_quark):
* Source/WebKit/UIProcess/API/glib/WebKitError.h.in:
* Source/WebKit/UIProcess/API/glib/WebKitPrivate.cpp:
(toWebKitWebExtensionError):
* Source/WebKit/UIProcess/API/glib/WebKitPrivate.h:
* Source/WebKit/UIProcess/API/glib/WebKitWebExtension.cpp: Added.
(webkit_web_extension_class_init):
(webkitWebExtensionCreate):
(webkitWebExtensionCreateWithBytes):
(webkit_web_extension_get_manifest_version):
(webkit_web_extension_supports_manifest_version):
(webkit_web_extension_get_default_locale):
(webkit_web_extension_get_display_name):
(webkit_web_extension_get_display_short_name):
(webkit_web_extension_get_display_version):
(webkit_web_extension_get_display_description):
(webkit_web_extension_get_display_action_label):
(webkit_web_extension_get_icon):
(webkit_web_extension_get_action_icon):
(webkit_web_extension_get_version):
(webkit_web_extension_get_requested_permissions):
(webkit_web_extension_get_optional_permissions):
(webkit_web_extension_get_requested_permission_match_patterns):
(webkit_web_extension_get_optional_permission_match_patterns):
(webkit_web_extension_get_all_requested_match_patterns):
(webkit_web_extension_get_has_background_content):
(webkit_web_extension_get_has_service_worker_background_content):
(webkit_web_extension_get_has_modular_background_content):
(webkit_web_extension_get_has_persistent_background_content):
(webkit_web_extension_get_has_injected_content):
(webkit_web_extension_get_has_options_page):
(webkit_web_extension_get_has_override_new_tab_page):
(webkit_web_extension_get_has_commands):
(webkit_web_extension_get_has_content_modification_rules):
* Source/WebKit/UIProcess/API/glib/WebKitWebExtension.h.in: Added.
* Source/WebKit/UIProcess/API/glib/WebKitWebExtensionInternal.h: Added.
* Source/WebKit/UIProcess/API/glib/webkit.h.in:
* Source/WebKit/UIProcess/Extensions/WebExtension.cpp:
* Source/WebKit/UIProcess/Extensions/WebExtension.h:
(WebKit::WebExtension::WebExtension):
* Source/WebKit/UIProcess/Extensions/gtk/WebExtensionGtk.cpp: Added.
(WebKit::WebExtension::WebExtension):
(WebKit::WebExtension::resourceDataForPath):
(WebKit::WebExtension::recordError):
(WebKit::WebExtension::iconForPath):
(WebKit::WebExtension::bestIcon):
* Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebExtension.cpp: Added.
(testDisplayStringParsing):
(testDefaultLocaleParsing):
(testDisplayStringParsingWithLocalization):
(testActionParsing):
(testContentScriptsParsing):
(testPermissionsParsing):
(testBackgroundParsing):
(testBackgroundPreferredEnvironmentParsing):
(testOptionsPageParsing):
(testURLOverridesParsing):
(testContentSecurityPolicyParsing):
(testWebAccessibleResourcesV2):
(testWebAccessibleResourcesV3):
(testCommandsParsing):
(testDeclarativeNetRequestParsing):
(testExternallyConnectableParsing):
(beforeAll):
(afterAll):
* Tools/TestWebKitAPI/glib/CMakeLists.txt:
* Tools/TestWebKitAPI/glib/WebKitGLib/WebExtensionUtilities.cpp: Copied from Source/WebKit/UIProcess/API/glib/WebKitPrivate.h.
(TestWebKitAPI::Util::makePNGData):
* Tools/TestWebKitAPI/glib/WebKitGLib/WebExtensionUtilities.h: Copied from Source/WebKit/UIProcess/API/glib/WebKitPrivate.h.

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