feat: Attribute network requests to frames (#1646)

This patch introduces `request.frame()` method that returns the frame that
initiated request.

Fixes #1579
This commit is contained in:
yujiosaka
2018-01-10 11:47:21 +09:00
committed by Andrey Lushnikov
parent 5843f6f775
commit c29822d663
5 changed files with 54 additions and 21 deletions

View File

@@ -179,6 +179,7 @@
* [request.abort([errorCode])](#requestaborterrorcode)
* [request.continue([overrides])](#requestcontinueoverrides)
* [request.failure()](#requestfailure)
* [request.frame()](#requestframe)
* [request.headers()](#requestheaders)
* [request.method()](#requestmethod)
* [request.postData()](#requestpostdata)
@@ -2061,6 +2062,9 @@ page.on('requestfailed', request => {
});
```
#### request.frame()
- returns: <?[Frame]> A matching [Frame] object, or `null` if navigating to error pages.
#### request.headers()
- returns: <[Object]> An object with HTTP headers associated with the request. All header names are lower-case.