chrome-har
Advanced tools
Comparing version 0.7.0 to 0.7.1
# CHANGELOG | ||
version 0.7.1 2018-12-13 | ||
------------------------- | ||
* Pickup requests/responses that happens before navigation and block some sctript navigations [#36](https://github.com/sitespeedio/chrome-har/pull/36). | ||
version 0.7.0 2018-11-23 | ||
@@ -4,0 +8,0 @@ ------------------------- |
30
index.js
@@ -48,2 +48,3 @@ 'use strict'; | ||
entriesWithoutPage = [], | ||
responsesWithoutPage = [], | ||
paramsWithoutPage = [], | ||
@@ -73,2 +74,8 @@ currentPageId; | ||
continue; | ||
} else if ( | ||
// This is something we've seen on Aftonbladets splash screens | ||
params.reason === 'scriptInitiated' && | ||
params.url === 'about:blank' | ||
) { | ||
continue; | ||
} | ||
@@ -96,2 +103,14 @@ } | ||
} | ||
if (responsesWithoutPage.length > 0) { | ||
for (let params of responsesWithoutPage) { | ||
let entry = entries.find( | ||
entry => entry.__requestId === params.requestId | ||
); | ||
if (entry) { | ||
populateEntryFromResponse(entry, params.response, page); | ||
} else { | ||
debug(`Couln't find matching request for response`); | ||
} | ||
} | ||
} | ||
} | ||
@@ -252,4 +271,6 @@ break; | ||
//we haven't loaded any pages yet. | ||
responsesWithoutPage.push(params); | ||
continue; | ||
} | ||
if (ignoredRequests.has(params.requestId)) { | ||
@@ -259,6 +280,12 @@ continue; | ||
const entry = entries.find( | ||
let entry = entries.find( | ||
entry => entry.__requestId === params.requestId | ||
); | ||
if (!entry) { | ||
entry = entriesWithoutPage.find( | ||
entry => entry.__requestId === params.requestId | ||
); | ||
} | ||
if (!entry) { | ||
debug( | ||
@@ -320,3 +347,2 @@ `Received network response for requestId ${ | ||
} | ||
entry.response.content.size += params.dataLength; | ||
@@ -323,0 +349,0 @@ } |
{ | ||
"name": "chrome-har", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Create HAR files from Chrome Debugging Protocol data.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
8651538
130168