← Back to Page domain

Page.addScriptToEvaluateOnLoad

Deprecated, please use addScriptToEvaluateOnNewDocument instead.

Domain: Page deprecated

Parameters

NameTypeDescription
scriptSourcestring

Returns

NameTypeDescription
identifierScriptIdentifierIdentifier of the added script.

Example Request

{
  "id": 1,
  "method": "Page.addScriptToEvaluateOnLoad",
  "params": {
    "scriptSource": "scriptSource-value"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "identifier": "identifier-value"
  }
}

Usage in Node.js

const result = await send('Page.addScriptToEvaluateOnLoad', {"scriptSource": "scriptSource-value"});
console.log(result);
// {"identifier": "identifier-value"}