← Back to Debugger domain
Debugger.searchInContent
Searches for given string in script content.
Domain: Debugger
stable
Parameters
| Name | Type | Description |
scriptId | Runtime.ScriptId | Id of the script to search in. |
query | string | String to search for. |
caseSensitive (optional) | boolean | If true, search is case sensitive. |
isRegex (optional) | boolean | If true, treats string parameter as regex. |
Returns
| Name | Type | Description |
result | array | List of search matches. |
Example Request
{
"id": 1,
"method": "Debugger.searchInContent",
"params": {
"scriptId": "1",
"query": "query-value"
}
}
Example Response
{
"id": 1,
"result": {
"result": {
"type": "string",
"value": "Example Domain"
}
}
}
Usage in Node.js
const result = await send('Debugger.searchInContent', {"scriptId": "1", "query": "query-value"});
console.log(result);
// {"result": {"type": "string", "value": "Example Domain"}}