WebKit.WebExtensionMatchPattern¶
Fields¶
None
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class WebKit.WebExtensionMatchPattern¶
Represents a way to specify a group of URLs for use in WebExtensions.
All match patterns are specified as strings. Apart from the special
<all_urls>
pattern, match patterns consist of three parts: scheme, host, and path.Generally, match patterns are returned from a #WebKitWebExtension.
New in version 2.48.
- classmethod new_all_hosts_and_schemes()¶
- Returns:
a newly created
WebKit.WebExtensionMatchPattern
- Return type:
Returns a new
WebKit.WebExtensionMatchPattern
that has*
for scheme, host, and path.New in version 2.48.
- classmethod new_all_urls()¶
- Returns:
a newly created
WebKit.WebExtensionMatchPattern
- Return type:
Returns a new
WebKit.WebExtensionMatchPattern
for<all_urls>
.New in version 2.48.
- classmethod new_with_scheme(scheme, host, path)¶
- Parameters:
- Raises:
- Returns:
a newly created
WebKit.WebExtensionMatchPattern
, orNone
if any of the pattern strings are invalid.- Return type:
Returns a new
WebKit.WebExtensionMatchPattern
for the specified scheme, host, and path strings.New in version 2.48.
- classmethod new_with_string(string)¶
- Parameters:
string (
str
) – A pattern string- Raises:
- Returns:
a newly created
WebKit.WebExtensionMatchPattern
, orNone
if the pattern string is invalid.- Return type:
Returns a new
WebKit.WebExtensionMatchPattern
for the specified string.New in version 2.48.
- classmethod register_custom_URL_scheme(urlScheme)¶
- Parameters:
urlScheme (
str
) – The custom URL scheme to register
Registers a custom URL scheme that can be used in match patterns.
This method should be used to register any custom URL schemes used by the app for the extension base URLs, other than
webkit-extension
, or if extensions should have access to other supported URL schemes when using<all_urls>
.New in version 2.48.
- get_host()¶
- Returns:
The host string.
- Return type:
Gets the host part of the pattern string, unless
webkit_web_extension_match_pattern_get_matches_all_urls
isTrue
.New in version 2.48.
- get_matches_all_hosts()¶
- Returns:
Whether this match pattern matches all hosts.
- Return type:
Gets whether the match pattern matches all host. This happens when the pattern is
<all_urls>
, or if*
is set as the host string.New in version 2.48.
- get_matches_all_urls()¶
- Returns:
Whether this match pattern matches all URLs.
- Return type:
Gets whether the match pattern matches all URLs, in other words, whether the pattern is
<all_urls>
.New in version 2.48.
- get_path()¶
- Returns:
The path string.
- Return type:
Gets the path part of the pattern string, unless [method`WebExtensionMatchPattern`.get_matches_all_urls] is
True
.New in version 2.48.
- get_scheme()¶
- Returns:
The scheme string.
- Return type:
Gets the scheme part of the pattern string, unless
webkit_web_extension_match_pattern_get_matches_all_urls
isTrue
.New in version 2.48.
- get_string()¶
- Returns:
The original pattern string.
- Return type:
Gets the original pattern string.
New in version 2.48.
- matches_pattern(pattern, options)¶
- Parameters:
pattern (
WebKit.WebExtensionMatchPattern
) – TheWebKit.WebExtensionMatchPattern
to match with self.options (
WebKit.WebExtensionMatchPatternOptions
) – TheWebKit.WebExtensionMatchPatternOptions
use while matching.
- Returns:
Whether the pattern matches the specified pattern.
- Return type:
Matches the self against the specified pattern with options.
New in version 2.48.
- matches_url(url, options)¶
- Parameters:
url (
str
) – The URL to match against the pattern.options (
WebKit.WebExtensionMatchPatternOptions
) – TheWebKit.WebExtensionMatchPatternOptions
use while matching.
- Returns:
Whether the pattern matches the specified URL.
- Return type:
Matches the self against the specified URL with options.
New in version 2.48.
- ref()¶
- Returns:
The same self with an additional reference.
- Return type:
Atomically acquires a reference on the given self.
This function is MT-safe and may be called from any thread.
New in version 2.48.
- unref()¶
Atomically releases a reference on the given self.
If the reference was the last, the resources associated to the self are freed. This function is MT-safe and may be called from any thread.
New in version 2.48.