@percy/core 1.30.7-beta.0 → 1.30.7-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/discovery.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import logger from '@percy/logger';
2
2
  import Queue from './queue.js';
3
3
  import Page from './page.js';
4
- import { normalizeURL, hostnameMatches, createResource, createRootResource, createPercyCSSResource, createLogResource, yieldAll, snapshotLogName, waitForTimeout, withRetries, waitForSelectorInsideBrowser } from './utils.js';
4
+ import { normalizeURL, hostnameMatches, createResource, createRootResource, createPercyCSSResource, createLogResource, yieldAll, snapshotLogName, waitForTimeout, withRetries, waitForSelectorInsideBrowser, isGzipped } from './utils.js';
5
5
  import { sha256hash } from '@percy/client/utils';
6
6
  import Pako from 'pako';
7
7
 
@@ -222,8 +222,12 @@ function processSnapshotResources({
222
222
  })));
223
223
  if (process.env.PERCY_GZIP) {
224
224
  for (let index = 0; index < resources.length; index++) {
225
- resources[index].content = Pako.gzip(resources[index].content);
226
- resources[index].sha = sha256hash(resources[index].content);
225
+ const alreadyZipped = isGzipped(resources[index].content);
226
+ /* istanbul ignore next: very hard to mock true */
227
+ if (!alreadyZipped) {
228
+ resources[index].content = Pako.gzip(resources[index].content);
229
+ resources[index].sha = sha256hash(resources[index].content);
230
+ }
227
231
  }
228
232
  }
229
233
  return {
package/dist/install.js CHANGED
@@ -162,13 +162,13 @@ export function chromium({
162
162
  });
163
163
  }
164
164
 
165
- // default chromium revisions corresponds to v123.0.6312.58
165
+ // default chromium revisions corresponds to v126.0.6478.184
166
166
  chromium.revisions = {
167
- linux: '1262506',
168
- win64: '1262500',
169
- win32: '1262500',
170
- darwin: '1262506',
171
- darwinArm: '1262509'
167
+ linux: '1300309',
168
+ win64: '1300297',
169
+ win32: '1300295',
170
+ darwin: '1300293',
171
+ darwinArm: '1300314'
172
172
  };
173
173
 
174
174
  // export the namespace by default
package/dist/utils.js CHANGED
@@ -389,6 +389,20 @@ export function redactSecrets(data) {
389
389
  export function base64encode(content) {
390
390
  return Buffer.from(content).toString('base64');
391
391
  }
392
+
393
+ // It checks if content is already gzipped or not.
394
+ // We don't want to gzip already gzipped content.
395
+ export function isGzipped(content) {
396
+ if (!(content instanceof Uint8Array || content instanceof ArrayBuffer)) {
397
+ return false;
398
+ }
399
+
400
+ // Ensure content is a Uint8Array
401
+ const data = content instanceof ArrayBuffer ? new Uint8Array(content) : content;
402
+
403
+ // Gzip magic number: 0x1f8b
404
+ return data.length > 2 && data[0] === 0x1f && data[1] === 0x8b;
405
+ }
392
406
  const RESERVED_CHARACTERS = {
393
407
  '%3A': ':',
394
408
  '%23': '#',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.30.7-beta.0",
3
+ "version": "1.30.7-beta.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,11 +43,11 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.30.7-beta.0",
47
- "@percy/config": "1.30.7-beta.0",
48
- "@percy/dom": "1.30.7-beta.0",
49
- "@percy/logger": "1.30.7-beta.0",
50
- "@percy/webdriver-utils": "1.30.7-beta.0",
46
+ "@percy/client": "1.30.7-beta.2",
47
+ "@percy/config": "1.30.7-beta.2",
48
+ "@percy/dom": "1.30.7-beta.2",
49
+ "@percy/logger": "1.30.7-beta.2",
50
+ "@percy/webdriver-utils": "1.30.7-beta.2",
51
51
  "content-disposition": "^0.5.4",
52
52
  "cross-spawn": "^7.0.3",
53
53
  "extract-zip": "^2.0.1",
@@ -60,5 +60,5 @@
60
60
  "ws": "^8.17.1",
61
61
  "yaml": "^2.4.1"
62
62
  },
63
- "gitHead": "4d589cecf982efeab69ea82881844447369a2af4"
63
+ "gitHead": "01d95d0569e70d0291d36b3c5d8da224d3014ebf"
64
64
  }