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

@applitools/dom-capture

Package Overview
Dependencies
Maintainers
12
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@applitools/dom-capture - npm Package Compare versions

Comparing version 6.0.2 to 6.0.3

37

dist/processPage.js

@@ -228,20 +228,25 @@

function doProcessResource(url) {
return fetchUrl(url).then(({url, type, value}) => {
const result = {blobsObj: {[url]: {type, value}}};
if (/text\/css/.test(type)) {
const styleSheet = findStyleSheetByUrl(url, doc);
if (!styleSheet) {
return fetchUrl(url)
.then(({url, type, value}) => {
const result = {blobsObj: {[url]: {type, value}}};
if (/text\/css/.test(type)) {
const styleSheet = findStyleSheetByUrl(url, doc);
if (!styleSheet) {
return result;
}
const resourceUrls = extractResourcesFromStyleSheet(styleSheet, doc.defaultView).map(
resourceUrl => absolutizeUrl(resourceUrl, url.replace(/^blob:/, '')),
);
return getResourceUrlsAndBlobs(resourceUrls).then(({resourceUrls, blobsObj}) => ({
resourceUrls,
blobsObj: Object.assign(blobsObj, {[url]: {type, value}}),
}));
} else {
return result;
}
const resourceUrls = extractResourcesFromStyleSheet(styleSheet, doc.defaultView).map(
resourceUrl => absolutizeUrl(resourceUrl, url.replace(/^blob:/, '')),
);
return getResourceUrlsAndBlobs(resourceUrls).then(({resourceUrls, blobsObj}) => ({
resourceUrls,
blobsObj: Object.assign(blobsObj, {[url]: {type, value}}),
}));
} else {
return result;
}
});
})
.catch(err => {
console.log('[dom-capture] error while fetching', url, err);
return {};
});
}

@@ -248,0 +253,0 @@ };

@@ -280,20 +280,25 @@

function doProcessResource(url) {
return fetchUrl(url).then(({url, type, value}) => {
const result = {blobsObj: {[url]: {type, value}}};
if (/text\/css/.test(type)) {
const styleSheet = findStyleSheetByUrl(url, doc);
if (!styleSheet) {
return fetchUrl(url)
.then(({url, type, value}) => {
const result = {blobsObj: {[url]: {type, value}}};
if (/text\/css/.test(type)) {
const styleSheet = findStyleSheetByUrl(url, doc);
if (!styleSheet) {
return result;
}
const resourceUrls = extractResourcesFromStyleSheet(styleSheet, doc.defaultView).map(
resourceUrl => absolutizeUrl(resourceUrl, url.replace(/^blob:/, '')),
);
return getResourceUrlsAndBlobs(resourceUrls).then(({resourceUrls, blobsObj}) => ({
resourceUrls,
blobsObj: Object.assign(blobsObj, {[url]: {type, value}}),
}));
} else {
return result;
}
const resourceUrls = extractResourcesFromStyleSheet(styleSheet, doc.defaultView).map(
resourceUrl => absolutizeUrl(resourceUrl, url.replace(/^blob:/, '')),
);
return getResourceUrlsAndBlobs(resourceUrls).then(({resourceUrls, blobsObj}) => ({
resourceUrls,
blobsObj: Object.assign(blobsObj, {[url]: {type, value}}),
}));
} else {
return result;
}
});
})
.catch(err => {
console.log('[dom-capture] error while fetching', url, err);
return {};
});
}

@@ -300,0 +305,0 @@ };

{
"name": "@applitools/dom-capture",
"version": "6.0.2",
"version": "6.0.3",
"main": "index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -14,20 +14,25 @@ 'use strict';

function doProcessResource(url) {
return fetchUrl(url).then(({url, type, value}) => {
const result = {blobsObj: {[url]: {type, value}}};
if (/text\/css/.test(type)) {
const styleSheet = findStyleSheetByUrl(url, doc);
if (!styleSheet) {
return fetchUrl(url)
.then(({url, type, value}) => {
const result = {blobsObj: {[url]: {type, value}}};
if (/text\/css/.test(type)) {
const styleSheet = findStyleSheetByUrl(url, doc);
if (!styleSheet) {
return result;
}
const resourceUrls = extractResourcesFromStyleSheet(styleSheet, doc.defaultView).map(
resourceUrl => absolutizeUrl(resourceUrl, url.replace(/^blob:/, '')),
);
return getResourceUrlsAndBlobs(resourceUrls).then(({resourceUrls, blobsObj}) => ({
resourceUrls,
blobsObj: Object.assign(blobsObj, {[url]: {type, value}}),
}));
} else {
return result;
}
const resourceUrls = extractResourcesFromStyleSheet(styleSheet, doc.defaultView).map(
resourceUrl => absolutizeUrl(resourceUrl, url.replace(/^blob:/, '')),
);
return getResourceUrlsAndBlobs(resourceUrls).then(({resourceUrls, blobsObj}) => ({
resourceUrls,
blobsObj: Object.assign(blobsObj, {[url]: {type, value}}),
}));
} else {
return result;
}
});
})
.catch(err => {
console.log('[dom-capture] error while fetching', url, err);
return {};
});
}

@@ -34,0 +39,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