It derives from <GObject>.
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.
The default locale for the
<WebKitWebExtension>. See
web-extension:get-default-locale for more details.
Its value is a string, or #f.
It is read only.
The localized extension action label of the
<WebKitWebExtension>. See
web-extension:get-display-action-label for
more details.
Its value is a string, or #f.
It is read only.
The localized description of the
<WebKitWebExtension>. See
web-extension:get-display-description for
more details.
Its value is a string, or #f.
It is read only.
The localized name of the
<WebKitWebExtension>. See
web-extension:get-display-name for more details.
Its value is a string, or #f.
It is read only.
The localized short name of the
<WebKitWebExtension>. See
web-extension:get-display-short-name for more
details.
Its value is a string, or #f.
It is read only.
The localized display version of the
<WebKitWebExtension>. See
web-extension:get-display-version for more
details.
Its value is a string, or #f.
It is read only.
Whether the <WebKitWebExtension> has
background content that can run when needed. See
web-extension:get-has-background-content?
for more details.
Its value is a boolean.
It is read only.
Whether the <WebKitWebExtension> includes
commands that users can invoke. See web-extension:get-has-commands? for more details.
Its value is a boolean.
It is read only.
Whether the <WebKitWebExtension> includes
rules used for content modification or blocking. See
webkit_web_extension_get_content_modification_rules() for more
details.
Its value is a boolean.
It is read only.
Whether the <WebKitWebExtension> has script
or stylesheet content that can be injected into webpages. See
web-extension:get-has-injected-content? for
more details.
Its value is a boolean.
It is read only.
Whether the <WebKitWebExtension> has an
options page. See web-extension:get-has-options-page? for more
details.
Its value is a boolean.
It is read only.
Whether the <WebKitWebExtension> provides an
alternative to the default new tab page. See web-extension:get-has-override-new-tab-page?
for more details.
Its value is a boolean.
It is read only.
Whether the <WebKitWebExtension> has
background content that stays in memory as long as the extension is
loaded. See web-extension:get-has-persistent-background-content?
for more details.
Its value is a boolean.
It is read only.
The parsed manifest version of the
<WebKitWebExtension>. See
web-extension:get-manifest-version for more
details.
Its value is a string, or #f.
It is read only.
The set of permissions that the
<WebKitWebExtension> may need for optional
functionality. See web-extension:get-optional-permissions for
more details.
Its value is a vector, each a string, or #f.
It is read only.
A string pointing to the folder containing the extension manifest and
resources. See web-extension:get-path for more details.
Its value is a string, or #f.
It can only be set when the object is made, with #:path.
The set of permissions that the
<WebKitWebExtension> requires for its base
functionality. See web-extension:get-requested-permissions for
more details.
Its value is a vector, each a string, or #f.
It is read only.
The version of the <WebKitWebExtension>. See
web-extension:get-version for
more details.
Its value is a string, or #f.
It is read only.
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.
Passed: a <WebKitWebExtension>.
Passed: a real number.
The width to use when looking up the icon.
Passed: a real number.
The height to use when looking up the icon.
Returned: a <GIcon>, or #f.
the icon image, or #f if no icon could be loaded.
Get the set of websites that the extension requires access to for injected content and for receiving messages from websites.
Passed: a <WebKitWebExtension>.
Returned: a vector, each a
<WebKitWebExtensionMatchPattern>.
a #f-terminated array of match patterns matching all requested
websites.
Get the default locale for the extension.
Passed: a <WebKitWebExtension>.
Returned: a string, or #f.
the default locale, or #f if there was no default locale
specified.
Get the localized display action label for the extension.
This label 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 label.
Passed: a <WebKitWebExtension>.
Returned: a string, or #f.
the localized display action label, or #f if there was no display
action label specified.
Get the localized display description for the extension.
Passed: a <WebKitWebExtension>.
Returned: a string, or #f.
the localized display description, or #f if there was no display
description specified.
Get the localized name for the extension.
Passed: a <WebKitWebExtension>.
Returned: a string, or #f.
the localized name, or #f if there was no name specified.
Get the localized short name for the extension.
Passed: a <WebKitWebExtension>.
Returned: a string, or #f.
the localized name, or #f if there was no short name specified.
Get the localized display version for the extension.
Passed: a <WebKitWebExtension>.
Returned: a string, or #f.
the localized display version, or #f if there was no display
version specified.
Get whether the extension has background content that can run when needed.
Passed: a <WebKitWebExtension>.
Returned: a boolean.
TRUE if the extension can run in the background even when no
webpages are open.
Get whether the extension includes commands that users can invoke.
These commands should be accessible via keyboard shortcuts, menu items, or other user interface elements provided by the app. The list of commands can be accessed via “commands“ on an extension context, and invoked via “performCommand:“.
Passed: a <WebKitWebExtension>.
Returned: a boolean.
TRUE if the extension contains one or more commands that can be
performed by the user.
Get whether the extension includes rules used for content modification or blocking.
Passed: a <WebKitWebExtension>.
Returned: a boolean.
TRUE if the extension contains one or more rules for content
modification.
Get whether the extension has script or stylesheet content that can be injected into webpages.
Once the extension is loaded, use the “hasInjectedContent“ property on an extension context, as the injectable content can change after the extension is loaded.
Passed: a <WebKitWebExtension>.
Returned: a boolean.
TRUE if the extension has content that can be injected by
matching against the extension’s requested match patterns.
Get whether the extension has an options page.
The app should provide access to this page through a user interface element, which can be accessed via “optionsPageURL“ on an extension context.
Passed: a <WebKitWebExtension>.
Returned: a boolean.
TRUE if the extension includes a dedicated options page where
users can customize settings.
Get whether the extension provides an alternative to the default new tab page.
The app should prompt the user for permission to use the extension’s new tab page as the default, which can be accessed via “overrideNewTabPageURL“ on an extension context.
Passed: a <WebKitWebExtension>.
Returned: a boolean.
TRUE if the extension can specify a custom page that can be
displayed when a new tab is opened in the app, instead of the default
new tab page.
Get whether the extension has background content that stays in memory as long as the extension is loaded.
Passed: a <WebKitWebExtension>.
Returned: a boolean.
TRUE if the extension can run in the background.
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 #f.
Passed: a <WebKitWebExtension>.
Passed: a real number.
The width to use when looking up the icon.
Passed: a real number.
The height to use when looking up the icon.
Returned: a <GIcon>, or #f.
the icon image, or #f if no icon could be loaded.
Get the parsed manifest version, or 0 if there is no version
specified in the manifest.
A WebKit.WebExtensionError.UNSUPPORTED_MANIFEST_VERSION error
will be reported if the manifest version isn’t specified.
Passed: a <WebKitWebExtension>.
Returned: a real number.
the parsed manifest version.
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.
Passed: a <WebKitWebExtension>.
Returned: a vector, each a
<WebKitWebExtensionMatchPattern>.
a #f-terminated array of match patterns matching the optional
websites.
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.
Passed: a <WebKitWebExtension>.
Returned: a vector, each a string, or #f.
a #f-terminated array of strings containing permission names, or
#f otherwise. This array and its contents are owned by WebKit
and should not be modified or freed.
Get the path pointing to the folder containing the extension manifest and resources
Passed: a <WebKitWebExtension>.
Returned: a string.
the path of the extension folder
Get the set of websites that the extension requires access to for its base functionality.
Passed: a <WebKitWebExtension>.
Returned: a vector, each a
<WebKitWebExtensionMatchPattern>.
a #f-terminated array of match patterns matching the required
websites.
Get the set of permissions that the extension requires for its base functionality.
Passed: a <WebKitWebExtension>.
Returned: a vector, each a string, or #f.
a #f-terminated array of strings containing permission names, or
#f otherwise. This array and its contents are owned by WebKit
and should not be modified or freed.
Get the version for the extension.
Passed: a <WebKitWebExtension>.
Returned: a string, or #f.
the version, or #f if there was no version specified.
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.
Passed: a string.
A string pointing to the folder containing the extension manifest and resources
Returned: a <WebKitWebExtension>, or
#f.
the new <WebKitWebExtension>, or #f if
the extension failed to be created
Checks if a manifest version is supported by the extension.
Passed: a <WebKitWebExtension>.
Passed: a real number.
the version number to check
Returned: a boolean.
TRUE if the extension specified a manifest version that is
greater than or equal to manifest-version.