WebKit2.UserScript.new

function new(source: String, injected_frames: WebKit2.UserContentInjectedFrames, injection_time: WebKit2.UserScriptInjectionTime, whitelist: Array(String), blacklist: Array(String)): WebKit2.UserScript {
    // Gjs wrapper for webkit_user_script_new()
}
  

Creates a new user script. Scripts can be applied to some URIs only by passing non-null values for whitelist or blacklist. Passing a null whitelist implies that all URIs are on the whitelist. The script is applied if an URI matches the whitelist and not the blacklist. 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.

Since 2.6

source

Source code of the user script.

injected_frames

A WebKit2.UserContentInjectedFrames value

injection_time

A WebKit2.UserScriptInjectionTime value

whitelist

A whitelist of URI patterns or null

blacklist

A blacklist of URI patterns or null

Returns

A new WebKit2.UserScript