> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extractbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# addInitScript

Adds a script that will be executed when new documents are created within the page.
This is useful for modifying the JavaScript environment of the page.
Example: `addInitScript(options: { content: "window.customVar = 123;" })`
Returns true if the script was successfully scheduled.

## Definition

```graphql theme={null}
addInitScript(
  options: AddInitScriptOptions!
): Boolean!
```

## Arguments

### `options`

[AddInitScriptOptions!](/reference/graphql/inputs/add-init-script-options)

Options specifying the script content.

## Returns

[Boolean!](/reference/graphql/scalars/boolean)

The `Boolean` scalar type represents `true` or `false`.
