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

# Override Document Functions

> Override native document prototype functions to intercept or manipulate their behavior

The Override Document Functions command (Command Type: 21) alters the browser's document prototype by overriding specific native functions, enabling interception or manipulation of their behavior.

## Command Type

**Command Type ID:** 21

## Parameters

| Parameter     | Type            | Description                                                                                                  | Required |
| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------ | -------- |
| **functions** | Array of string | List of native document functions to override. Each must be a valid method/property of the `Document` object | Yes      |
| **timeout**   | number          | Timeout in milliseconds                                                                                      | Yes      |

### Common Function Keys

`"cookie"`, `"title"`, `"domain"`, `"referrer"`, `"URL"`, `"readyState"`, `"visibilityState"`, `"hidden"`, `"body"`, `"head"`

## Usage Examples

### Override document.cookie

```json theme={null}
{
  "command": "override-document-functions",
  "params": {
    "functions": ["cookie"],
    "timeout": 5000
  }
}
```

### Override Multiple Properties

```json theme={null}
{
  "command": "override-document-functions",
  "params": {
    "functions": ["domain", "referrer", "URL"],
    "timeout": 5000
  }
}
```

## Common Use Cases

* **Anti-Detection**: Override properties that anti-scraping systems check
* **State Interception**: Intercept cookie or title changes for tracking

## Related Commands

* [Run Custom Code](/stream/commands/browser/run-custom-code) - Arbitrary JS execution
* [Override Headers](/stream/commands/browser/override-headers) - Override network request headers
