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.4.0 to 2.5.0

5

CHANGELOG.md
# CHANGELOG - PageXray
version 2.5.0 2018-11-16
------------------------
### Added
* If you don't add your own firstparty regex, we set a default one based on the hostname. If your hostname is www.sitespeed.io we will use *.sitespeed.* [#68](https://github.com/sitespeedio/pagexray/pull/68).
version 2.4.0 2018-10-05

@@ -4,0 +9,0 @@ ------------------------

10

lib/index.js

@@ -102,3 +102,8 @@ 'use strict';

const finalUrl = finalEntry.request.url;
const baseDomain = util.getHostname(finalUrl);
// If there is no setup for a first party setup,
// then use a default one
if (!firstParty) {
firstParty = '.*' + util.getMainDomain(baseDomain) + '.*';
}
currentPage = {

@@ -108,3 +113,4 @@ url: entry.request.url,

finalUrl,
baseDomain: util.getHostname(finalUrl),
baseDomain: baseDomain,
firstPartyRegEx: firstParty,
documentRedirects: redirectChain.length,

@@ -111,0 +117,0 @@ redirectChain,

@@ -74,2 +74,24 @@ 'use strict';

/**
* Get the main domain from a hostname
* www.sitespeed.io -> sitespeed
* www.sitespeed.co.uk -> sitespeed
*/
getMainDomain: hostname => {
let domain = hostname;
if (hostname != null) {
const parts = hostname.split('.').reverse();
if (parts != null && parts.length > 1) {
domain = parts[1] + '.' + parts[0];
if (
hostname.toLowerCase().indexOf('.co.uk') != -1 &&
parts.length > 2
) {
domain = parts[2] + '.' + domain;
}
}
}
return domain.split('.')[0];
},
/**
* Get when the page is fully loaded

@@ -76,0 +98,0 @@ * @param {Object} pageId

2

package.json
{
"name": "pagexray",
"version": "2.4.0",
"version": "2.5.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