Skip to main content
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

ParameterTypeDescriptionRequired
functionsArray of stringList of native document functions to override. Each must be a valid method/property of the Document objectYes
timeoutnumberTimeout in millisecondsYes

Common Function Keys

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

Usage Examples

{
  "command": "override-document-functions",
  "params": {
    "functions": ["cookie"],
    "timeout": 5000
  }
}

Override Multiple Properties

{
  "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