← Back to Debugger domain
Debugger.getScriptSource
Returns source for the script with given id.
Domain: Debugger
stable
Parameters
| Name | Type | Description |
scriptId | Runtime.ScriptId | Id of the script to get source for. |
Returns
| Name | Type | Description |
scriptSource | string | Script source (empty in case of Wasm bytecode). |
bytecode | string | Wasm bytecode. (Encoded as a base64 string when passed over JSON) |
Example Request
{
"id": 1,
"method": "Debugger.getScriptSource",
"params": {
"scriptId": "1"
}
}
Example Response
{
"id": 1,
"result": {
"scriptSource": "scriptSource-value",
"bytecode": "bytecode-value"
}
}
Usage in Node.js
const result = await send('Debugger.getScriptSource', {"scriptId": "1"});
console.log(result);
// {"scriptSource": "scriptSource-value", "bytecode": "bytecode-value"}