3.20 <WebKitWebExtensionMatchPattern>

Structure: <WebKitWebExtensionMatchPattern>

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>.

Procedures

Method: web-extension-match-pattern:get-host self ⇒ %return
Method: get-host self ⇒ %return

Gets the host part of the pattern string, unless web-extension-match-pattern:get-matches-all-urls? is #t.

self

Passed: a <WebKitWebExtensionMatchPattern>.

A <WebKitWebExtensionMatchPattern>

%return

Returned: a string.

The host string.

Method: web-extension-match-pattern:get-matches-all-hosts? self ⇒ %return
Method: get-matches-all-hosts? self ⇒ %return

Gets whether the match pattern matches all host. This happens when the pattern is <all_urls>, or if * is set as the host string.

self

Passed: a <WebKitWebExtensionMatchPattern>.

A <WebKitWebExtensionMatchPattern>

%return

Returned: a boolean.

Whether this match pattern matches all hosts.

Method: web-extension-match-pattern:get-matches-all-urls? self ⇒ %return
Method: get-matches-all-urls? self ⇒ %return

Gets whether the match pattern matches all URLs, in other words, whether the pattern is <all_urls>.

self

Passed: a <WebKitWebExtensionMatchPattern>.

A <WebKitWebExtensionMatchPattern>

%return

Returned: a boolean.

Whether this match pattern matches all URLs.

Method: web-extension-match-pattern:get-path self ⇒ %return
Method: get-path self ⇒ %return

Gets the path part of the pattern string, unless WebExtensionMatchPattern.get_matches_all_urls is #t.

self

Passed: a <WebKitWebExtensionMatchPattern>.

A <WebKitWebExtensionMatchPattern>

%return

Returned: a string.

The path string.

Method: web-extension-match-pattern:get-scheme self ⇒ %return
Method: get-scheme self ⇒ %return

Gets the scheme part of the pattern string, unless web-extension-match-pattern:get-matches-all-urls? is #t.

self

Passed: a <WebKitWebExtensionMatchPattern>.

A <WebKitWebExtensionMatchPattern>

%return

Returned: a string.

The scheme string.

Method: web-extension-match-pattern:get-string self ⇒ %return
Method: get-string self ⇒ %return

Gets the original pattern string.

self

Passed: a <WebKitWebExtensionMatchPattern>.

A <WebKitWebExtensionMatchPattern>

%return

Returned: a string.

The original pattern string.

Method: web-extension-match-pattern:matches-pattern? self pattern options ⇒ %return
Method: matches-pattern? self pattern options ⇒ %return

Matches the self against the specified pattern with options.

self

Passed: a <WebKitWebExtensionMatchPattern>.

A <WebKitWebExtensionMatchPattern> to match against.

pattern

Passed: a <WebKitWebExtensionMatchPattern>.

The <WebKitWebExtensionMatchPattern> to match with self.

options

Passed: a <WebKitWebExtensionMatchPatternOptions>, or a list of its symbols, or one of them.

The <WebKitWebExtensionMatchPatternOptions> use while matching.

%return

Returned: a boolean.

Whether the pattern matches the specified pattern.

Method: web-extension-match-pattern:matches-url? self url options ⇒ %return
Method: matches-url? self url options ⇒ %return

Matches the self against the specified URL with options.

self

Passed: a <WebKitWebExtensionMatchPattern>.

A <WebKitWebExtensionMatchPattern>

url

Passed: a string.

The URL to match against the pattern.

options

Passed: a <WebKitWebExtensionMatchPatternOptions>, or a list of its symbols, or one of them.

The <WebKitWebExtensionMatchPatternOptions> use while matching.

%return

Returned: a boolean.

Whether the pattern matches the specified URL.

Procedure: web-extension-match-pattern:new-all-hosts-and-schemes ⇒ %return

Returns a new <WebKitWebExtensionMatchPattern> that has * for scheme, host, and path.

%return

Returned: a <WebKitWebExtensionMatchPattern>.

a newly created <WebKitWebExtensionMatchPattern>

Procedure: web-extension-match-pattern:new-all-urls ⇒ %return

Returns a new <WebKitWebExtensionMatchPattern> for <all_urls>.

%return

Returned: a <WebKitWebExtensionMatchPattern>.

a newly created <WebKitWebExtensionMatchPattern>

Procedure: web-extension-match-pattern:new-with-scheme scheme host path ⇒ %return

Returns a new <WebKitWebExtensionMatchPattern> for the specified scheme, host, and path strings.

scheme

Passed: a string.

A pattern URL scheme

host

Passed: a string.

A pattern URL host

path

Passed: a string.

A pattern URL path

%return

Returned: a <WebKitWebExtensionMatchPattern>, or #f.

a newly created <WebKitWebExtensionMatchPattern>, or #f if any of the pattern strings are invalid.

Procedure: web-extension-match-pattern:new-with-string string ⇒ %return

Returns a new <WebKitWebExtensionMatchPattern> for the specified string.

string

Passed: a string.

A pattern string

%return

Returned: a <WebKitWebExtensionMatchPattern>, or #f.

a newly created <WebKitWebExtensionMatchPattern>, or #f if the pattern string is invalid.

Method: web-extension-match-pattern:ref self ⇒ %return
Method: ref self ⇒ %return

Atomically acquires a reference on the given self.

This function is MT-safe and may be called from any thread.

self

Passed: a <WebKitWebExtensionMatchPattern>.

a <WebKitWebExtensionMatchPattern>

%return

Returned: a <WebKitWebExtensionMatchPattern>.

The same self with an additional reference.

Procedure: web-extension-match-pattern:register-custom-url-scheme url-scheme

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>.

url-scheme

Passed: a string.

The custom URL scheme to register

Procedure: web-extension-match-pattern:register-custom-url-scheme url-scheme

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>.

url-scheme

Passed: a string.

The custom URL scheme to register

Method: web-extension-match-pattern:unref self
Method: unref self

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.

self

Passed: a <WebKitWebExtensionMatchPattern>.

a <WebKitWebExtensionMatchPattern>