| 15 | export type ResponseSchema = Array<CDPJSONPayload>; |
| 16 | |
| 17 | export default class ChromiumJSONListGetRoute extends HTTPRoute { |
| 18 | name = BrowserlessRoutes.ChromiumJSONListGetRoute; |
| 19 | accepts = [contentTypes.any]; |
| 20 | auth = true; |
| 21 | browser = null; |
| 22 | concurrency = false; |
| 23 | contentTypes = [contentTypes.json]; |
| 24 | description = dedent(` |
| 25 | Returns a JSON payload that acts as a pass-through to the DevTools /json/list HTTP API in Chromium and Chrome. |
| 26 | Browserless crafts this payload so that remote clients can connect to the underlying "webSocketDebuggerUrl" |
| 27 | properly, excluding any API tokens in that URL. If under authentication be sure to include your authorization. |
| 28 | `); |
| 29 | method = Methods.get; |
| 30 | path = HTTPRoutes.jsonList; |
| 31 | tags = [APITags.browserAPI]; |
| 32 | |
| 33 | async handler(_req: Request, res: Response): Promise<void> { |
| 34 | const browserManage = this.browserManager(); |
| 35 | return jsonResponse(res, 200, await browserManage.getJSONList()); |
| 36 | } |
| 37 | } |