@percy/core
Advanced tools
Comparing version 1.29.4-beta.2 to 1.29.4-beta.3
@@ -64,2 +64,15 @@ import logger from '@percy/logger'; | ||
// parse browser cookies in correct format if flag is enabled | ||
// it assumes that cookiesStr is string returned by document.cookie | ||
function parseCookies(cookiesStr) { | ||
if (process.env.PERCY_DO_NOT_USE_CAPTURED_COOKIES === 'true' || !(typeof cookiesStr === 'string' && cookiesStr !== '')) return null; | ||
return cookiesStr.split('; ').map(c => { | ||
const eqIdx = c.indexOf('='); | ||
return { | ||
name: c.substring(0, eqIdx), | ||
value: c.substring(eqIdx + 1) | ||
}; | ||
}); | ||
} | ||
// Wait for a page's asset discovery network to idle | ||
@@ -167,2 +180,3 @@ function waitForDiscoveryNetworkIdle(page, options) { | ||
async function* captureSnapshotResources(page, snapshot, options) { | ||
var _snapshot$domSnapshot; | ||
const log = logger('core:discovery'); | ||
@@ -181,16 +195,3 @@ let { | ||
} = options; | ||
let cookies; | ||
if (process.env.PERCY_DO_NOT_USE_CAPTURED_COOKIES !== 'true') { | ||
var _snapshot$domSnapshot; | ||
cookies = snapshot === null || snapshot === void 0 ? void 0 : (_snapshot$domSnapshot = snapshot.domSnapshot) === null || _snapshot$domSnapshot === void 0 ? void 0 : _snapshot$domSnapshot.cookies; | ||
} | ||
if (typeof cookies === 'string' && cookies !== '') { | ||
cookies = cookies.split('; ').map(c => c.split('=')); | ||
cookies = cookies.map(([key, value]) => { | ||
return { | ||
name: key, | ||
value: value | ||
}; | ||
}); | ||
} | ||
let cookies = parseCookies(snapshot === null || snapshot === void 0 ? void 0 : (_snapshot$domSnapshot = snapshot.domSnapshot) === null || _snapshot$domSnapshot === void 0 ? void 0 : _snapshot$domSnapshot.cookies); | ||
@@ -197,0 +198,0 @@ // iterate over device to trigger reqeusts and capture other dpr width |
@@ -513,3 +513,3 @@ import { request as makeRequest } from '@percy/client/utils'; | ||
if (mimeType !== null && mimeType !== void 0 && mimeType.includes('font') || detectedMime && detectedMime.includes('font')) { | ||
log.debug('- Requesting asset directly'); | ||
log.debug('- Requesting asset directly', meta); | ||
body = await makeDirectRequest(network, request); | ||
@@ -529,3 +529,3 @@ } | ||
log.debug(`Encountered an error processing resource: ${url}`, meta); | ||
log.debug(error); | ||
log.debug(error, meta); | ||
} | ||
@@ -532,0 +532,0 @@ } |
{ | ||
"name": "@percy/core", | ||
"version": "1.29.4-beta.2", | ||
"version": "1.29.4-beta.3", | ||
"license": "MIT", | ||
@@ -46,7 +46,7 @@ "repository": { | ||
"dependencies": { | ||
"@percy/client": "1.29.4-beta.2", | ||
"@percy/config": "1.29.4-beta.2", | ||
"@percy/dom": "1.29.4-beta.2", | ||
"@percy/logger": "1.29.4-beta.2", | ||
"@percy/webdriver-utils": "1.29.4-beta.2", | ||
"@percy/client": "1.29.4-beta.3", | ||
"@percy/config": "1.29.4-beta.3", | ||
"@percy/dom": "1.29.4-beta.3", | ||
"@percy/logger": "1.29.4-beta.3", | ||
"@percy/webdriver-utils": "1.29.4-beta.3", | ||
"content-disposition": "^0.5.4", | ||
@@ -64,3 +64,3 @@ "cross-spawn": "^7.0.3", | ||
}, | ||
"gitHead": "f316b7f672fbec81d3f13c53591735f102bc17a1" | ||
"gitHead": "8c61c0ad7a8a1b61f199a2a011ac296764cdc2eb" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
409607
+ Added@percy/client@1.29.4-beta.3(transitive)
+ Added@percy/config@1.29.4-beta.3(transitive)
+ Added@percy/dom@1.29.4-beta.3(transitive)
+ Added@percy/env@1.29.4-beta.3(transitive)
+ Added@percy/logger@1.29.4-beta.3(transitive)
+ Added@percy/sdk-utils@1.29.4-beta.3(transitive)
+ Added@percy/webdriver-utils@1.29.4-beta.3(transitive)
- Removed@percy/client@1.29.4-beta.2(transitive)
- Removed@percy/config@1.29.4-beta.2(transitive)
- Removed@percy/dom@1.29.4-beta.2(transitive)
- Removed@percy/env@1.29.4-beta.2(transitive)
- Removed@percy/logger@1.29.4-beta.2(transitive)
- Removed@percy/sdk-utils@1.29.4-beta.2(transitive)
- Removed@percy/webdriver-utils@1.29.4-beta.2(transitive)
Updated@percy/client@1.29.4-beta.3
Updated@percy/config@1.29.4-beta.3
Updated@percy/dom@1.29.4-beta.3
Updated@percy/logger@1.29.4-beta.3