added web_response

This commit is contained in:
2026-06-06 19:49:40 -04:00
parent c86151ac82
commit 27261e0751
8 changed files with 223 additions and 6 deletions

View File

@@ -103,6 +103,31 @@ Gets the browser's user agent string.
**Returns:** `string` on success, `false` on failure.
## `fplay.web_response_whitelist(sources)`
Outputs the response body for specific data sources. `sources` can is an array that can contain:
- `main_frame`
- `sub_frame`
- `stylesheet`
- `script`
- `image`
- `object`
- `xmlhttprequest`
- `ping`
- `font`
- `media`
- `websocket`
- `csp_report`
- `imageset`
- `web_manifest`
- `speculative`
- `other`
Default is `main_frame`, `xmlhttprequest`.
**Returns:** `boolean` `true`.
### `fplay.wait_random(min, max)`
Waits for an inclusive amount of time in miliseconds.
@@ -281,7 +306,8 @@ An `EventEmitter` instance that emits the following events:
| `browser_disconnect` | `{}` | Browser disconnected |
| `dom_ready` | `{ id, index, status, active, title, url, container }` | A tab finished loading |
| `dom_load_fail` | `{ id }` | A tab failed to load |
| `web_request` | `{ id, url, status, origin, type, method, container, headers }` | A main-frame request was sent |
| `web_request` | `{ id, url, status, origin, type, method, container, headers }` | A request was sent |
| `web_response` | `{ id, url, status, origin, type, method, container, body }` | A response was received |
---