WebKit.WebExtension¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
[ |
r |
||
r/w/co |
|||
[ |
r |
||
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class WebKit.WebExtension(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Represents a WebExtension.
A
WebKit.WebExtensionobject 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.
New in version 2.52.
- classmethod new(extension_path)¶
- Parameters:
extension_path (
str) – A string pointing to the folder containing the extension manifest and resources- Raises:
- Returns:
the new
WebKit.WebExtension, orNoneif the extension failed to be created- Return type:
Creates a new
WebKit.WebExtensionfrom a folder containing the extension contents. The folder must contain amanifest.jsonfile. If the manifest is invalid or missing, an error will be returned.New in version 2.52.
- get_action_icon(width, height)¶
- Parameters:
- Returns:
the icon image, or
Noneif no icon could be loaded.- Return type:
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.New in version 2.52.
- get_all_requested_match_patterns()¶
- Returns:
a
None-terminated array of match patterns matching all requested websites.- Return type:
Get the set of websites that the extension requires access to for injected content and for receiving messages from websites.
New in version 2.52.
- get_default_locale()¶
- Returns:
the default locale, or
Noneif there was no default locale specified.- Return type:
Get the default locale for the extension.
New in version 2.52.
- get_display_action_label()¶
- Returns:
the localized display action label, or
Noneif there was no display action label specified.- Return type:
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.New in version 2.52.
- get_display_description()¶
- Returns:
the localized display description, or
Noneif there was no display description specified.- Return type:
Get the localized display description for the extension.
New in version 2.52.
- get_display_name()¶
-
Get the localized name for the extension.
New in version 2.52.
- get_display_short_name()¶
-
Get the localized short name for the extension.
New in version 2.52.
- get_display_version()¶
- Returns:
the localized display version, or
Noneif there was no display version specified.- Return type:
Get the localized display version for the extension.
New in version 2.52.
- get_has_background_content()¶
- Returns:
TRUEif the extension can run in the background even when no webpages are open.- Return type:
Get whether the extension has background content that can run when needed.
New in version 2.52.
- get_has_commands()¶
- Returns:
TRUEif the extension contains one or more commands that can be performed by the user.- Return type:
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
commandson an extension context, and invoked viaperformCommand:.New in version 2.52.
- get_has_content_modification_rules()¶
- Returns:
TRUEif the extension contains one or more rules for content modification.- Return type:
Get whether the extension includes rules used for content modification or blocking.
New in version 2.52.
- get_has_injected_content()¶
- Returns:
TRUEif the extension has content that can be injected by matching against the extension’s requested match patterns.- Return type:
Get whether the extension has script or stylesheet content that can be injected into webpages.
Once the extension is loaded, use the
hasInjectedContentproperty on an extension context, as the injectable content can change after the extension is loaded.New in version 2.52.
- get_has_options_page()¶
- Returns:
TRUEif the extension includes a dedicated options page where users can customize settings.- Return type:
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
optionsPageURLon an extension context.New in version 2.52.
- get_has_override_new_tab_page()¶
- Returns:
TRUEif 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.- Return type:
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
overrideNewTabPageURLon an extension context.New in version 2.52.
- get_has_persistent_background_content()¶
- Returns:
TRUEif the extension can run in the background.- Return type:
Get whether the extension has background content that stays in memory as long as the extension is loaded.
New in version 2.52.
- get_icon(width, height)¶
- Parameters:
- Returns:
the icon image, or
Noneif no icon could be loaded.- Return type:
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
None.New in version 2.52.
- get_manifest_version()¶
- Returns:
the parsed manifest version.
- Return type:
Get the parsed manifest version, or
0if there is no version specified in the manifest.A [error`WebKit`.WebExtensionError.UNSUPPORTED_MANIFEST_VERSION] error will be reported if the manifest version isn’t specified.
New in version 2.52.
- get_optional_permission_match_patterns()¶
- Returns:
a
None-terminated array of match patterns matching the optional websites.- Return type:
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.
New in version 2.52.
- get_optional_permissions()¶
- Returns:
a
None-terminated array of strings containing permission names, orNoneotherwise. This array and its contents are owned by WebKit and should not be modified or freed.- Return type:
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.
New in version 2.52.
- get_path()¶
- Returns:
the path of the extension folder
- Return type:
Get the path pointing to the folder containing the extension manifest and resources
New in version 2.52.
- get_requested_permission_match_patterns()¶
- Returns:
a
None-terminated array of match patterns matching the required websites.- Return type:
Get the set of websites that the extension requires access to for its base functionality.
New in version 2.52.
- get_requested_permissions()¶
- Returns:
a
None-terminated array of strings containing permission names, orNoneotherwise. This array and its contents are owned by WebKit and should not be modified or freed.- Return type:
Get the set of permissions that the extension requires for its base functionality.
New in version 2.52.
- get_version()¶
-
Get the version for the extension.
New in version 2.52.
- supports_manifest_version(manifest_version)¶
- Parameters:
manifest_version (
float) – the version number to check- Returns:
TRUEif the extension specified a manifest version that is greater than or equal to manifest_version.- Return type:
Checks if a manifest version is supported by the extension.
New in version 2.52.
Property Details¶
- WebKit.WebExtension.props.default_locale¶
-
The default locale for the
WebKit.WebExtension. SeeWebKit.WebExtension.get_default_locale() for more details.New in version 2.52.
- WebKit.WebExtension.props.display_action_label¶
-
The localized extension action label of the
WebKit.WebExtension. SeeWebKit.WebExtension.get_display_action_label() for more details.New in version 2.52.
- WebKit.WebExtension.props.display_description¶
-
The localized description of the
WebKit.WebExtension. SeeWebKit.WebExtension.get_display_description() for more details.New in version 2.52.
- WebKit.WebExtension.props.display_name¶
-
The localized name of the
WebKit.WebExtension. SeeWebKit.WebExtension.get_display_name() for more details.New in version 2.52.
- WebKit.WebExtension.props.display_short_name¶
-
The localized short name of the
WebKit.WebExtension. SeeWebKit.WebExtension.get_display_short_name() for more details.New in version 2.52.
- WebKit.WebExtension.props.display_version¶
-
The localized display version of the
WebKit.WebExtension. SeeWebKit.WebExtension.get_display_version() for more details.New in version 2.52.
- WebKit.WebExtension.props.has_background_content¶
-
Whether the
WebKit.WebExtensionhas background content that can run when needed. SeeWebKit.WebExtension.get_has_background_content() for more details.New in version 2.52.
- WebKit.WebExtension.props.has_commands¶
-
Whether the
WebKit.WebExtensionincludes commands that users can invoke. SeeWebKit.WebExtension.get_has_commands() for more details.New in version 2.52.
- WebKit.WebExtension.props.has_content_modification_rules¶
-
Whether the
WebKit.WebExtensionincludes rules used for content modification or blocking. See webkit_web_extension_get_content_modification_rules() for more details.New in version 2.52.
- WebKit.WebExtension.props.has_injected_content¶
-
Whether the
WebKit.WebExtensionhas script or stylesheet content that can be injected into webpages. SeeWebKit.WebExtension.get_has_injected_content() for more details.New in version 2.52.
- WebKit.WebExtension.props.has_options_page¶
-
Whether the
WebKit.WebExtensionhas an options page. SeeWebKit.WebExtension.get_has_options_page() for more details.New in version 2.52.
- WebKit.WebExtension.props.has_override_new_tab_page¶
-
Whether the
WebKit.WebExtensionprovides an alternative to the default new tab page. SeeWebKit.WebExtension.get_has_override_new_tab_page() for more details.New in version 2.52.
- WebKit.WebExtension.props.has_persistent_background_content¶
-
Whether the
WebKit.WebExtensionhas background content that stays in memory as long as the extension is loaded. SeeWebKit.WebExtension.get_has_persistent_background_content() for more details.New in version 2.52.
- WebKit.WebExtension.props.manifest_version¶
-
The parsed manifest version of the
WebKit.WebExtension. SeeWebKit.WebExtension.get_manifest_version() for more details.New in version 2.52.
- WebKit.WebExtension.props.optional_permissions¶
-
The set of permissions that the
WebKit.WebExtensionmay need for optional functionality. SeeWebKit.WebExtension.get_optional_permissions() for more details.New in version 2.52.
- WebKit.WebExtension.props.path¶
- Name:
path- Type:
- Default Value:
- Flags:
A string pointing to the folder containing the extension manifest and resources. See
WebKit.WebExtension.get_path() for more details.New in version 2.52.
- WebKit.WebExtension.props.requested_permissions¶
-
The set of permissions that the
WebKit.WebExtensionrequires for its base functionality. SeeWebKit.WebExtension.get_requested_permissions() for more details.New in version 2.52.
- WebKit.WebExtension.props.version¶
-
The version of the
WebKit.WebExtension. SeeWebKit.WebExtension.get_version() for more details.New in version 2.52.