Function
WPEWebKitUserScriptnew
Declaration [src]
WebKitUserScript*
webkit_user_script_new (
const gchar* source,
WebKitUserContentInjectedFrames injected_frames,
WebKitUserScriptInjectionTime injection_time,
const gchar* const* allow_list,
const gchar* const* block_list
)
Description [src]
Creates a new user script.
Scripts can be applied to some URIs
only by passing non-null values for allow_list or block_list. Passing a
NULL allow_list implies that all URIs are on the allow_list. The script
is applied if an URI matches the allow_list and not the block_list.
URI patterns must be of the form [protocol]://[host]/[path], where the
host and path components can contain the wildcard character (*) to
represent zero or more other characters.
| Available since: | 2.6 |
Parameters
source |
const gchar* |
Source code of the user script. |
|
| The data is owned by the caller of the function. | |
| The value is a NUL terminated UTF-8 string. | |
injected_frames |
WebKitUserContentInjectedFrames |
A |
|
injection_time |
WebKitUserScriptInjectionTime |
A |
|
allow_list |
An array of gchar* |
An allow_list of URI patterns or |
|
The argument can be NULL. | |
The array must be NULL-terminated. | |
| The data is owned by the caller of the function. | |
| Each element is a NUL terminated UTF-8 string. | |
block_list |
An array of gchar* |
A block_list of URI patterns or |
|
The argument can be NULL. | |
The array must be NULL-terminated. | |
| The data is owned by the caller of the function. | |
| Each element is a NUL terminated UTF-8 string. |
Return value
| Returns: | WebKitUserScript |
A new |
|
| The caller of the function takes ownership of the data, and is responsible for freeing it. |