### Function

# WebKit2 UserScript new_for_world

since: 2.22

#### Declaration [src]

    WebKitUserScript*
    webkit_user_script_new_for_world (
      const gchar* source,
      WebKitUserContentInjectedFrames injected_frames,
      WebKitUserScriptInjectionTime injection_time,
      const gchar* world_name,
      const gchar* const* allow_list,
      const gchar* const* block_list
    )

#### Description [src]

Creates a new user script for script world with name `world_name`.

See `webkit_user_script_new()` for a full description.

Available since: 2.22

#### Parameters

`source`

  Type: `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`

  Type: `WebKitUserContentInjectedFrames`

  A `WebKitUserContentInjectedFrames` value.

`injection_time`

  Type: `WebKitUserScriptInjectionTime`

  A `WebKitUserScriptInjectionTime` value.

`world_name`

  Type: `const gchar*`

  The name of a `WebKitScriptWorld`.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`allow_list`

  Type: An array of `gchar*`

  An allow_list of URI patterns or `NULL`.

  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`

  Type: An array of `gchar*`

  A block_list of URI patterns or `NULL`.

  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

Type: `WebKitUserScript`

A new `WebKitUserScript`.

The caller of the function takes ownership of the data, and is responsible for freeing it.