WebKit.WebExtension
Description: Reference for WebKit.WebExtension

### Class

# WebKitWebExtension

since: 2.52

#### Description [src]

    final class WebKit.WebExtension : GObject.Object
      implements Gio.Initable {
      /* No available fields */
    }

Represents a WebExtension.

A `WebKitWebExtension` object encapsulates a web extension’s resources that are defined by a `manifest.json` file.

This class handles the reading and parsing of the manifest file along with the supporting resources like icons and localizations.

Available since: 2.52

#### Ancestors

- GObject

#### Implements

- GInitable

#### Constructors

###### webkit_web_extension_new

Creates a new WebKitWebExtension from a folder containing the extension contents. The folder must contain a `manifest.json` file. If the manifest is invalid or missing, an error will be returned.

since: 2.52

#### Instance methods

###### webkit_web_extension_get_action_icon

Returns the extension’s default action icon image for the specified size. This icon serves as a default and should be used to represent the extension in contexts like action sheets or toolbars prior to the extension being loaded into an extension context. Once the extension is loaded, use the `actionForTab:` API to get the tab-specific icon. The returned image will be the best match for the specified size that is available in the extension’s action icon set. If no matching icon is available, the method will fall back to the extension’s icon.

since: 2.52

###### webkit_web_extension_get_all_requested_match_patterns

Get the set of websites that the extension requires access to for injected content and for receiving messages from websites.

since: 2.52

###### webkit_web_extension_get_default_locale

Get the default locale for the extension.

since: 2.52

###### webkit_web_extension_get_display_action_label

Get the localized display action label for the extension.

since: 2.52

###### webkit_web_extension_get_display_description

Get the localized display description for the extension.

since: 2.52

###### webkit_web_extension_get_display_name

Get the localized name for the extension.

since: 2.52

###### webkit_web_extension_get_display_short_name

Get the localized short name for the extension.

since: 2.52

###### webkit_web_extension_get_display_version

Get the localized display version for the extension.

since: 2.52

###### webkit_web_extension_get_has_background_content

Get whether the extension has background content that can run when needed.

since: 2.52

###### webkit_web_extension_get_has_commands

Get whether the extension includes commands that users can invoke.

since: 2.52

###### webkit_web_extension_get_has_content_modification_rules

Get whether the extension includes rules used for content modification or blocking.

since: 2.52

###### webkit_web_extension_get_has_injected_content

Get whether the extension has script or stylesheet content that can be injected into webpages.

since: 2.52

###### webkit_web_extension_get_has_options_page

Get whether the extension has an options page.

since: 2.52

###### webkit_web_extension_get_has_override_new_tab_page

Get whether the extension provides an alternative to the default new tab page.

since: 2.52

###### webkit_web_extension_get_has_persistent_background_content

Get whether the extension has background content that stays in memory as long as the extension is loaded.

since: 2.52

###### webkit_web_extension_get_icon

Returns the extension’s icon image for the specified size. This icon should represent the extension in settings or other areas that show the extension. The returned image will be the best match for the specified size that is available in the extension’s icon set. If no matching icon can be found, the method will return `NULL`.

since: 2.52

###### webkit_web_extension_get_manifest_version

Get the parsed manifest version, or `0` if there is no version specified in the manifest.

since: 2.52

###### webkit_web_extension_get_optional_permission_match_patterns

Get the set of websites that the extension may need access to for optional functionality. These match patterns can be requested by the extension at a later time.

since: 2.52

###### webkit_web_extension_get_optional_permissions

Get the set of permissions that the extension may need for optional functionality. These permissions can be requested by the extension at a later time.

since: 2.52

###### webkit_web_extension_get_path

Get the path pointing to the folder containing the extension manifest and resources.

since: 2.52

###### webkit_web_extension_get_requested_permission_match_patterns

Get the set of websites that the extension requires access to for its base functionality.

since: 2.52

###### webkit_web_extension_get_requested_permissions

Get the set of permissions that the extension requires for its base functionality.

since: 2.52

###### webkit_web_extension_get_version

Get the version for the extension.

since: 2.52

###### webkit_web_extension_supports_manifest_version

Checks if a manifest version is supported by the extension.

since: 2.52

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

##### Methods inherited from GInitable (1)

###### g_initable_init

Initializes the object implementing the interface.

#### Properties

###### WebKit.WebExtension:default-locale

The default locale for the `WebKitWebExtension`. See `webkit_web_extension_get_default_locale()` for more details.

since: 2.52

###### WebKit.WebExtension:display-action-label

The localized extension action label of the `WebKitWebExtension`. See `webkit_web_extension_get_display_action_label()` for more details.

since: 2.52

###### WebKit.WebExtension:display-description

The localized description of the `WebKitWebExtension`. See `webkit_web_extension_get_display_description()` for more details.

since: 2.52

###### WebKit.WebExtension:display-name

The localized name of the `WebKitWebExtension`. See `webkit_web_extension_get_display_name()` for more details.

since: 2.52

###### WebKit.WebExtension:display-short-name

The localized short name of the `WebKitWebExtension`. See `webkit_web_extension_get_display_short_name()` for more details.

since: 2.52

###### WebKit.WebExtension:display-version

The localized display version of the `WebKitWebExtension`. See `webkit_web_extension_get_display_version()` for more details.

since: 2.52

###### WebKit.WebExtension:has-background-content

Whether the `WebKitWebExtension` has background content that can run when needed. See `webkit_web_extension_get_has_background_content()` for more details.

since: 2.52

###### WebKit.WebExtension:has-commands

Whether the `WebKitWebExtension` includes commands that users can invoke. See `webkit_web_extension_get_has_commands()` for more details.

since: 2.52

###### WebKit.WebExtension:has-content-modification-rules

Whether the `WebKitWebExtension` includes rules used for content modification or blocking. See `webkit_web_extension_get_content_modification_rules()` for more details.

since: 2.52

###### WebKit.WebExtension:has-injected-content

Whether the `WebKitWebExtension` has script or stylesheet content that can be injected into webpages. See `webkit_web_extension_get_has_injected_content()` for more details.

since: 2.52

###### WebKit.WebExtension:has-options-page

Whether the `WebKitWebExtension` has an options page. See `webkit_web_extension_get_has_options_page()` for more details.

since: 2.52

###### WebKit.WebExtension:has-override-new-tab-page

Whether the `WebKitWebExtension` provides an alternative to the default new tab page. See `webkit_web_extension_get_has_override_new_tab_page()` for more details.

since: 2.52

###### WebKit.WebExtension:has-persistent-background-content

Whether the `WebKitWebExtension` has background content that stays in memory as long as the extension is loaded. See `webkit_web_extension_get_has_persistent_background_content()` for more details.

since: 2.52

###### WebKit.WebExtension:manifest-version

The parsed manifest version of the `WebKitWebExtension`. See `webkit_web_extension_get_manifest_version()` for more details.

since: 2.52

###### WebKit.WebExtension:optional-permissions

The set of permissions that the `WebKitWebExtension` may need for optional functionality. See `webkit_web_extension_get_optional_permissions()` for more details.

since: 2.52

###### WebKit.WebExtension:path

A string pointing to the folder containing the extension manifest and resources. See `webkit_web_extension_get_path()` for more details.

since: 2.52

###### WebKit.WebExtension:requested-permissions

The set of permissions that the `WebKitWebExtension` requires for its base functionality. See `webkit_web_extension_get_requested_permissions()` for more details.

since: 2.52

###### WebKit.WebExtension:version

The version of the `WebKitWebExtension`. See `webkit_web_extension_get_version()` for more details.

since: 2.52

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct WebKitWebExtensionClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.