# Run page JavaScript

Node type `browser_injectJavaScript`

## What it does

Run JavaScript in the page when the action needs browser document access.

## Desktop client configuration

![Run page JavaScript configuration in the desktop client](/assets/inject-java-script.9c689498b6dcffb8a7b14e78bafdda313c402532c0e264f664dff533253a499a.0538f3a9.webp)

Captured in the English interface of MoreLogin Desktop V2.73.101.

## Inputs

These fields belong in `data.browserUi.inputs`.

| Field | Type or values | Schema required | Execution default | Description and bounds |
|  --- | --- | --- | --- | --- |
| `params` | array<`object`> | No | `[]` | params. Editor initial value `[]` |
| `content` | `string` | No | — | Script to inject |
| `outputFormat` | `object` (supports variable references) | No | `{"type":"object"}` | Output format. Editor initial value `{"type":"object"}` |
| `executionTimeoutMs` | `WorkflowNumber` | No | `3000` | Execution timeout (ms); minimum after resolution: 100; maximum after resolution: 30000. Editor initial value `3000` |


## Mode requirements and limits

- The node accepts only an entered script. Pass values explicitly through params. Constant parameters of type object/array must be valid JSON objects/arrays (validated on write). The script runs asynchronously in the real page, with an execution timeout of 100–30000ms.
- Validation code `RPA_NODE_INPUT_INVALID`


## Input references

| Field | Allowed forms |
|  --- | --- |
| `params` | `literal`, `template` |
| `content` | `literal`, `template` |
| `outputFormat` | `literal`, `template` |
| `executionTimeoutMs` | `literal`, `numericExpression` |


## Outputs

| Output field | Type or values |
|  --- | --- |
| `result` | `["null","boolean","number","string"]` / array<`JSON`> / `object` |
| `injected` | `true` |


Reference published fields as `${nodeId.data.field}`.

## JSON example

A complete node object for a workflow's `nodes` array or another node's `blocks`.

```json
{
  "id": "page_info",
  "type": "browser_injectJavaScript",
  "data": {
    "title": "Read the title and link count from the page",
    "browserAction": "injectJavaScript",
    "browserUi": {
      "inputs": {
        "params": [],
        "content": "return { title: document.title, links: document.links.length };",
        "outputFormat": {
          "type": "object"
        },
        "executionTimeoutMs": 3000
      },
      "exception": {
        "timeout": 30000,
        "policy": "interrupt"
      }
    }
  }
}
```

[Back to the node catalog](/browser-rpa/nodes)