New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

resourcetiming-compression

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resourcetiming-compression - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

package.json

@@ -6,3 +6,3 @@ {

"author": "Nic Jansma",
"version": "0.3.0",
"version": "0.3.1",
"repository": {

@@ -9,0 +9,0 @@ "type": "git",

# resourcetiming-compression.js
v0.3.0
v0.3.1

@@ -173,2 +173,3 @@ [http://nicj.net](http://nicj.net)

* v0.3.1 - 2016-07-15: Fixed capturing of resource sizes (bytes)
* v0.3.0 - 2016-07-11:

@@ -175,0 +176,0 @@ * Captures dimensions (px) of resources

@@ -286,3 +286,3 @@ //

ResourceTimingCompression.findPerformanceEntriesForFrame = function(frame, isTopWindow, offset, depth) {
var entries = [], i, navEntries, navStart, frameNavStart, frameOffset, navEntry, t, frameLoc;
var entries = [], i, navEntries, navStart, frameNavStart, frameOffset, navEntry, t, frameLoc, rtEntry;

@@ -402,3 +402,3 @@ if (typeof isTopWindow === "undefined") {

t = frameEntries[i];
frameFixedEntries.push({
rtEntry = {
name: t.name,

@@ -418,3 +418,9 @@ initiatorType: t.initiatorType,

responseEnd: t.responseEnd ? (t.responseEnd + offset) : 0
});
};
if (t.encodedBodySize || t.decodedBodySize || t.transferSize) {
rtEntry.encodedBodySize = t.encodedBodySize;
rtEntry.decodedBodySize = t.decodedBodySize;
rtEntry.transferSize = t.transferSize;
}
frameFixedEntries.push(rtEntry);
}

@@ -421,0 +427,0 @@

@@ -51,2 +51,12 @@ //

// Any ResourceTiming data time that starts with this character is not a time,
// but something else (like dimension data)
var SPECIAL_DATA_PREFIX = "*";
// Dimension data special type
var SPECIAL_DATA_DIMENSION_TYPE = "0";
// Dimension data special type
var SPECIAL_DATA_SIZE_TYPE = "1";
/**

@@ -87,3 +97,3 @@ * Decompresses a compressed ResourceTiming trie

var resourceData = timings[i];
if (resourceData.length > 0 && resourceData[0] === "*") {
if (resourceData.length > 0 && resourceData[0] === SPECIAL_DATA_PREFIX) {
// dimensions for this resource

@@ -138,3 +148,5 @@ continue;

var initiatorType = parseInt(data[0], 10);
var timings = data.length > 1 ? data.substring(1).split(",") : [];
data = data.length > 1 ? data.split(SPECIAL_DATA_PREFIX + SPECIAL_DATA_SIZE_TYPE) : [];
var timings = data.length > 0 && data[0].length > 1 ? data[0].substring(1).split(",") : [];
var sizes = data.length > 1 ? data[1] : "";

@@ -180,2 +192,7 @@ // convert all timings from base36

// decompress resource size data
if (sizes.length > 0) {
this.decompressSize(sizes, res);
}
return res;

@@ -182,0 +199,0 @@ };

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