Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pagexray

Package Overview
Dependencies
Maintainers
3
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pagexray - npm Package Compare versions

Comparing version 2.2.2 to 2.3.0

6

CHANGELOG.md
# CHANGELOG - PageXray
version 2.3.0 2018-05-12
------------------------
### Added
* Count requests/size that happens after onContentLoad and onLoad.
* Calculate fullyLoaded.
version 2.2.2 2018-04-25

@@ -4,0 +10,0 @@ ------------------------

37

lib/index.js

@@ -85,2 +85,11 @@ 'use strict';

// Summarize the timings for all pages
const pageTimings = {};
for (let page of har.log.pages) {
const pageStartTime = new Date(page.startedDateTime).getTime();
pageTimings[page.id] = {
onLoad: pageStartTime + page.pageTimings.onLoad,
onContentLoad: pageStartTime + page.pageTimings.onContentLoad
};
}
entries.forEach(entry => {

@@ -107,2 +116,7 @@ if (!testedPages[entry.pageref]) {

missingCompression: 0,
fullyLoaded: util.getFullyLoaded(
entry.pageref,
entries,
entry.startedDateTime
),
httpType: util.getConnectionType(httpVersion),

@@ -124,3 +138,13 @@ httpVersion: util.getHTTPVersion(httpVersion),

lastModifiedStats: new Statistics(),
cookieStats: new Statistics()
cookieStats: new Statistics(),
afterOnContentLoad: {
requests: 0,
transferSize: 0,
contentTypes: collect.defaultContentTypes()
},
afterOnLoad: {
requests: 0,
transferSize: 0,
contentTypes: collect.defaultContentTypes()
}
};

@@ -158,2 +182,13 @@

const entryStart = new Date(entry.startedDateTime).getTime();
if (entryStart > pageTimings[entry.pageref].onLoad) {
currentPage.afterOnLoad.requests += 1;
currentPage.afterOnLoad.transferSize += entry.response.bodySize;
collect.contentType(asset, currentPage.afterOnLoad.contentTypes);
}
if (entryStart > pageTimings[entry.pageref].onContentLoad) {
currentPage.afterOnContentLoad.requests += 1;
currentPage.afterOnContentLoad.transferSize += entry.response.bodySize;
collect.contentType(asset, currentPage.afterOnContentLoad.contentTypes);
}
// add first/third party info

@@ -160,0 +195,0 @@ if (firstParty) {

@@ -69,2 +69,26 @@ 'use strict';

/**
* Get when the page is fully loaded
* @param {Object} pageId
* @param entries
* @param {Object} pageStartDateTime
*/
getFullyLoaded: (pageId, entries, pageStartDateTime) => {
let pageEntries = Array.from(entries);
pageEntries = Array.from(
pageEntries.filter(entry => entry.pageref === pageId)
);
let pageEnd = 0;
for (let entry of pageEntries) {
let entryEnd =
new Date(entry.startedDateTime).getTime() +
entry.time -
new Date(pageStartDateTime).getTime();
if (entryEnd > pageEnd) {
pageEnd = entryEnd;
}
}
return pageEnd;
},
/**
* Get main document requests (including redirects) for a HAR file.

@@ -71,0 +95,0 @@ * @param entries

2

package.json
{
"name": "pagexray",
"version": "2.2.2",
"version": "2.3.0",
"description": "Xray your HAR file and know all about the page",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc