@applitools/eyes-browser 1.6.17 → 1.6.18

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +160 -0
  2. package/dist/index.js +338 -26
  3. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,165 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.6.18](https://github.com/Applitools-Dev/sdk/compare/js/eyes-browser@1.6.17...js/eyes-browser@1.6.18) (2026-05-26)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * @applitools/utils bumped to 1.14.5
9
+ #### Bug Fixes
10
+
11
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
12
+ * @applitools/logger bumped to 2.2.12
13
+ #### Bug Fixes
14
+
15
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
16
+
17
+
18
+
19
+ * @applitools/dom-shared bumped to 1.2.1
20
+ #### Bug Fixes
21
+
22
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
23
+ * @applitools/dom-snapshot bumped to 4.17.2
24
+ #### Bug Fixes
25
+
26
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
27
+
28
+
29
+
30
+ * @applitools/socket bumped to 1.3.13
31
+ #### Bug Fixes
32
+
33
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
34
+
35
+
36
+
37
+ * @applitools/req bumped to 1.10.2
38
+ #### Bug Fixes
39
+
40
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
41
+
42
+
43
+
44
+ * @applitools/image bumped to 1.2.11
45
+ #### Bug Fixes
46
+
47
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
48
+
49
+
50
+
51
+ * @applitools/snippets bumped to 2.9.2
52
+ #### Bug Fixes
53
+
54
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
55
+
56
+
57
+
58
+ * @applitools/dom-capture bumped to 11.8.1
59
+ #### Bug Fixes
60
+
61
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
62
+
63
+
64
+
65
+ * @applitools/driver bumped to 1.26.2
66
+ #### Bug Fixes
67
+
68
+ * redact cookie values from logs to prevent sensitive data exposure | AD-12834 ([#3835](https://github.com/Applitools-Dev/sdk/issues/3835)) ([d883647](https://github.com/Applitools-Dev/sdk/commit/d883647d8e007467bd2770ddb79f89be057067b9))
69
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
70
+
71
+
72
+
73
+ * @applitools/spec-driver-webdriver bumped to 1.6.2
74
+ #### Bug Fixes
75
+
76
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
77
+
78
+
79
+
80
+ * @applitools/spec-driver-selenium bumped to 1.8.2
81
+ #### Bug Fixes
82
+
83
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
84
+
85
+
86
+
87
+ * @applitools/spec-driver-playwright bumped to 1.9.2
88
+ #### Bug Fixes
89
+
90
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
91
+
92
+
93
+
94
+ * @applitools/spec-driver-puppeteer bumped to 1.8.2
95
+ #### Bug Fixes
96
+
97
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
98
+
99
+
100
+
101
+ * @applitools/screenshoter bumped to 3.12.21
102
+ #### Bug Fixes
103
+
104
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
105
+
106
+
107
+
108
+ * @applitools/nml-client bumped to 1.11.28
109
+ #### Bug Fixes
110
+
111
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
112
+
113
+
114
+
115
+ * @applitools/tunnel-client bumped to 1.11.14
116
+ #### Bug Fixes
117
+
118
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
119
+
120
+
121
+
122
+ * @applitools/ufg-client bumped to 1.22.2
123
+ #### Bug Fixes
124
+
125
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
126
+ * strip extra fields from checkResources log output ([#3836](https://github.com/Applitools-Dev/sdk/issues/3836)) ([6d75209](https://github.com/Applitools-Dev/sdk/commit/6d752094abb6fcc0e998cf95e1f266964dbfd6f3))
127
+
128
+
129
+
130
+ * @applitools/core-base bumped to 1.34.1
131
+ #### Bug Fixes
132
+
133
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
134
+
135
+
136
+
137
+ * @applitools/ec-client bumped to 1.12.30
138
+ #### Bug Fixes
139
+
140
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
141
+
142
+
143
+
144
+ * @applitools/core bumped to 4.63.1
145
+ #### Bug Fixes
146
+
147
+ * prevent BrightCove/video.js player corruption during layoutBreakpoints snapshots ([#3828](https://github.com/Applitools-Dev/sdk/issues/3828)) ([380fbae](https://github.com/Applitools-Dev/sdk/commit/380fbaeb1c6a964c640975f1a109417db51f691c))
148
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
149
+ * truly disable NML broker URL cache between checks | FLD-4283 ([#3837](https://github.com/Applitools-Dev/sdk/issues/3837)) ([da76dd3](https://github.com/Applitools-Dev/sdk/commit/da76dd3227c3297320be0d19558a7437b5733999))
150
+
151
+
152
+
153
+ * @applitools/eyes bumped to 1.42.1
154
+ #### Bug Fixes
155
+
156
+ * strip .d.ts extension from import() type specifiers | FLD-4429 ([#3830](https://github.com/Applitools-Dev/sdk/issues/3830)) ([37aac45](https://github.com/Applitools-Dev/sdk/commit/37aac45958b713702bea87c144623dd3e65fce79))
157
+
158
+
159
+
160
+ * @applitools/test-server bumped to 1.4.4
161
+
162
+
3
163
  ## [1.6.17](https://github.com/Applitools-Dev/sdk/compare/js/eyes-browser@1.6.16...js/eyes-browser@1.6.17) (2026-05-19)
4
164
 
5
165
 
package/dist/index.js CHANGED
@@ -80468,7 +80468,7 @@ var require_driver = __commonJS({
80468
80468
  return [];
80469
80469
  try {
80470
80470
  const cookies = await ((_b = (_a = this._spec).getCookies) === null || _b === void 0 ? void 0 : _b.call(_a, this.target));
80471
- this._logger.log("Extracted driver cookies", cookies);
80471
+ this._logger.log("Extracted driver cookies, number of cookies:", cookies === null || cookies === void 0 ? void 0 : cookies.length);
80472
80472
  return cookies !== null && cookies !== void 0 ? cookies : [];
80473
80473
  } catch (error) {
80474
80474
  this._logger.error("Error while extracting driver cookies", error);
@@ -82690,7 +82690,7 @@ ${l2}`}`, { bundledCss: u2, unfetchedResources: a2 };
82690
82690
  return m3 && (k2.shadowRoot = m3), k2;
82691
82691
  }
82692
82692
  }(t3);
82693
- f2(l2.doCaptureDoc), d2(l2.waitForImages), await Promise.all(m2), f2(l2.waitForImages), T2.version = "1.4.0", T2.scriptVersion = "11.8.0";
82693
+ f2(l2.doCaptureDoc), d2(l2.waitForImages), await Promise.all(m2), f2(l2.waitForImages), T2.version = "1.4.0", T2.scriptVersion = "11.8.1";
82694
82694
  const N2 = p2.length ? `${p2.join("\n")}
82695
82695
  ` : "", P2 = h2.size ? `${Array.from(h2).join("\n")}
82696
82696
  ` : "", A2 = JSON.stringify({ separator: w2, cssStartToken: y2, cssEndToken: y2, iframeStartToken: `"${g2}`, iframeEndToken: `${g2}"` });
@@ -89676,7 +89676,7 @@ var require_captureDomPollForIE = __commonJS({
89676
89676
  case 24:
89677
89677
  return L2 = e4.sent, A2(E2.prefetchCss), j2 = U0({ parseCss: D0, CSSImportRule, getCssFromCache: L2, absolutizeUrl: j0, unfetchedToken: _2 }), k2 = z0({ getCssFromCache: L2, absolutizeUrl: j0 }), C2 = V0({ extractCssFromNode: k2, getBundledCssFromCssText: j2, unfetchedToken: _2 }), S2(E2.doCaptureDoc), M2 = H2(i3), A2(E2.doCaptureDoc), S2(E2.waitForImages), e4.next = 35, Promise.all(O2);
89678
89678
  case 35:
89679
- return A2(E2.waitForImages), M2.version = "1.4.0", M2.scriptVersion = "11.8.0", N2 = T2.length ? T2.join("\n") + "\n" : "", U2 = x2.size ? Array.from(x2).join("\n") + "\n" : "", D2 = JSON.stringify({ separator: P2, cssStartToken: _2, cssEndToken: _2, iframeStartToken: '"' + R2, iframeEndToken: R2 + '"' }), A2(E2.total), B2 = JSON.stringify(M2), z2 = D2 + "\n" + U2 + P2 + "\n" + N2 + P2 + "\n" + ("string" == typeof B2 ? B2 : H0(M2)) + F2(), console.log("[captureFrame]", JSON.stringify(E2)), e4.abrupt("return", z2);
89679
+ return A2(E2.waitForImages), M2.version = "1.4.0", M2.scriptVersion = "11.8.1", N2 = T2.length ? T2.join("\n") + "\n" : "", U2 = x2.size ? Array.from(x2).join("\n") + "\n" : "", D2 = JSON.stringify({ separator: P2, cssStartToken: _2, cssEndToken: _2, iframeStartToken: '"' + R2, iframeEndToken: R2 + '"' }), A2(E2.total), B2 = JSON.stringify(M2), z2 = D2 + "\n" + U2 + P2 + "\n" + N2 + P2 + "\n" + ("string" == typeof B2 ? B2 : H0(M2)) + F2(), console.log("[captureFrame]", JSON.stringify(E2)), e4.abrupt("return", z2);
89680
89680
  case 46:
89681
89681
  case "end":
89682
89682
  return e4.stop();
@@ -96716,14 +96716,16 @@ var require_get_nml_client = __commonJS({
96716
96716
  var nml_client_1 = require_dist5();
96717
96717
  var utils_1 = require_browser3();
96718
96718
  var clients = /* @__PURE__ */ new Map();
96719
+ var cacheDisabled = /* @__PURE__ */ new Set();
96719
96720
  function clearNMLClients() {
96720
96721
  clients.clear();
96722
+ cacheDisabled.clear();
96721
96723
  }
96722
96724
  exports.clearNMLClients = clearNMLClients;
96723
96725
  function makeGetNMLClient({ client, logger: mainLogger }) {
96724
96726
  return {
96725
96727
  getNMLClient,
96726
- clearNMLClientCache
96728
+ disableNMLClientCache
96727
96729
  };
96728
96730
  async function getNMLClient({ driver, settings, logger }) {
96729
96731
  if (client)
@@ -96731,25 +96733,29 @@ var require_get_nml_client = __commonJS({
96731
96733
  logger = logger.extend(mainLogger);
96732
96734
  const { sessionId } = await driver.getDriverInfo();
96733
96735
  const cacheKey = sessionId !== null && sessionId !== void 0 ? sessionId : driver.guid;
96734
- const clientFromCache = clients.get(cacheKey);
96735
- if (clientFromCache) {
96736
- return clientFromCache;
96736
+ if (cacheDisabled.has(cacheKey)) {
96737
+ logger.log("NML broker url cache is disabled for this session \u2014 re-extracting broker url");
96737
96738
  } else {
96738
- const brokerUrl = await driver.extractBrokerUrl();
96739
- if (!brokerUrl)
96740
- throw new Error("Unable to extract broker url from the device");
96741
- if (utils_1.types.has(brokerUrl, "error")) {
96742
- logger.error("Broker url extraction has failed with error", brokerUrl.error);
96743
- throw new Error(brokerUrl.error);
96744
- }
96745
- const nmlClient = (0, nml_client_1.makeNMLClient)({ settings: { brokerUrl, ...settings }, logger });
96739
+ const clientFromCache = clients.get(cacheKey);
96740
+ if (clientFromCache)
96741
+ return clientFromCache;
96742
+ }
96743
+ const brokerUrl = await driver.extractBrokerUrl();
96744
+ if (!brokerUrl)
96745
+ throw new Error("Unable to extract broker url from the device");
96746
+ if (utils_1.types.has(brokerUrl, "error")) {
96747
+ logger.error("Broker url extraction has failed with error", brokerUrl.error);
96748
+ throw new Error(brokerUrl.error);
96749
+ }
96750
+ const nmlClient = (0, nml_client_1.makeNMLClient)({ settings: { brokerUrl, ...settings }, logger });
96751
+ if (!cacheDisabled.has(cacheKey))
96746
96752
  clients.set(cacheKey, nmlClient);
96747
- return nmlClient;
96748
- }
96753
+ return nmlClient;
96749
96754
  }
96750
- async function clearNMLClientCache(driver) {
96755
+ async function disableNMLClientCache(driver) {
96751
96756
  const { sessionId } = await driver.getDriverInfo();
96752
96757
  const cacheKey = sessionId !== null && sessionId !== void 0 ? sessionId : driver.guid;
96758
+ cacheDisabled.add(cacheKey);
96753
96759
  clients.delete(cacheKey);
96754
96760
  }
96755
96761
  }
@@ -104651,7 +104657,7 @@ creating temp style for access.`), r2 = Qh(e3);
104651
104657
  function M2(e3) {
104652
104658
  return r3.defaultView && r3.defaultView.frameElement && r3.defaultView.frameElement.getAttribute(e3);
104653
104659
  }
104654
- }(n3).then((e3) => (m2.log("processPage end"), e3.scriptVersion = "4.17.1", e3));
104660
+ }(n3).then((e3) => (m2.log("processPage end"), e3.scriptVersion = "4.17.2", e3));
104655
104661
  }, n2[S], "domSnapshotResult");
104656
104662
  return function(e3) {
104657
104663
  try {
@@ -105283,6 +105289,305 @@ var require_calculate_required_sizes = __commonJS({
105283
105289
  }
105284
105290
  });
105285
105291
 
105292
+ // ../core/dist/ufg/utils/media-playback-guard.js
105293
+ var require_media_playback_guard = __commonJS({
105294
+ "../core/dist/ufg/utils/media-playback-guard.js"(exports) {
105295
+ "use strict";
105296
+ init_global();
105297
+ init_process();
105298
+ init_setImmediate();
105299
+ init_buffer();
105300
+ init_setInterval();
105301
+ Object.defineProperty(exports, "__esModule", { value: true });
105302
+ exports.pagePayload = exports.makeMediaPlaybackGuard = void 0;
105303
+ function makeMediaPlaybackGuard({ context, logger }) {
105304
+ const ns = "__applitools_mpg_" + Math.random().toString(36).slice(2) + "__";
105305
+ return {
105306
+ setup: () => runPhase("setup"),
105307
+ beforeResize: () => runPhase("beforeResize"),
105308
+ beforeSnapshot: () => runPhase("beforeSnapshot"),
105309
+ afterSnapshot: () => runPhase("afterSnapshot"),
105310
+ teardown: () => runPhase("teardown")
105311
+ };
105312
+ function runPhase(phase) {
105313
+ return context.execute(pagePayload, { ns, phase }).catch((err) => logger.warn(`media guard: ${phase} failed`, err));
105314
+ }
105315
+ }
105316
+ exports.makeMediaPlaybackGuard = makeMediaPlaybackGuard;
105317
+ function pagePayload(arg) {
105318
+ const w = window;
105319
+ const ns = arg.ns;
105320
+ if (!w[ns])
105321
+ install();
105322
+ const state = w[ns];
105323
+ if (state && typeof state[arg.phase] === "function")
105324
+ state[arg.phase]();
105325
+ function install() {
105326
+ const videoUndos = /* @__PURE__ */ new WeakMap();
105327
+ const captionUndos = /* @__PURE__ */ new WeakMap();
105328
+ const playerSnapshots = [];
105329
+ const originalProtoPlay = HTMLMediaElement.prototype.play;
105330
+ const originalCreateElement = document.createElement.bind(document);
105331
+ const originalCreateElementNS = document.createElementNS.bind(document);
105332
+ let observer = null;
105333
+ function walkAll(root, fn) {
105334
+ const els = root.querySelectorAll("*");
105335
+ for (let i = 0; i < els.length; i++) {
105336
+ const el = els[i];
105337
+ fn(el);
105338
+ const sr = el.shadowRoot;
105339
+ if (sr)
105340
+ walkAll(sr, fn);
105341
+ }
105342
+ }
105343
+ function walkVideos(root, fn) {
105344
+ walkAll(root, (el) => {
105345
+ if (el.tagName === "VIDEO")
105346
+ fn(el);
105347
+ });
105348
+ }
105349
+ function walkCaptions(root, fn) {
105350
+ walkAll(root, (el) => {
105351
+ const cl = el.classList;
105352
+ if (cl && cl.contains("vjs-text-track-display"))
105353
+ fn(el);
105354
+ });
105355
+ }
105356
+ function overrideOwn(obj, key, replacement) {
105357
+ const wasOwn = Object.prototype.hasOwnProperty.call(obj, key);
105358
+ const original = wasOwn ? obj[key] : void 0;
105359
+ obj[key] = replacement;
105360
+ return function restore() {
105361
+ if (wasOwn)
105362
+ obj[key] = original;
105363
+ else
105364
+ delete obj[key];
105365
+ };
105366
+ }
105367
+ function runUndos(undos) {
105368
+ for (let i = undos.length - 1; i >= 0; i--) {
105369
+ try {
105370
+ undos[i]();
105371
+ } catch (_) {
105372
+ }
105373
+ }
105374
+ }
105375
+ function lockVideo(video) {
105376
+ if (videoUndos.has(video))
105377
+ return;
105378
+ const undos = [];
105379
+ const hadAutoplay = video.hasAttribute("autoplay");
105380
+ if (hadAutoplay)
105381
+ video.removeAttribute("autoplay");
105382
+ try {
105383
+ Object.defineProperty(video, "autoplay", {
105384
+ configurable: true,
105385
+ get: () => false,
105386
+ set: () => {
105387
+ }
105388
+ });
105389
+ } catch (_) {
105390
+ }
105391
+ undos.push(() => {
105392
+ try {
105393
+ delete video.autoplay;
105394
+ } catch (_) {
105395
+ }
105396
+ if (hadAutoplay)
105397
+ video.setAttribute("autoplay", "");
105398
+ });
105399
+ undos.push(overrideOwn(video, "setAttribute", function(name, value) {
105400
+ if (name === "autoplay")
105401
+ return;
105402
+ return Element.prototype.setAttribute.call(this, name, value);
105403
+ }));
105404
+ if (video.captureStream) {
105405
+ undos.push(overrideOwn(video, "captureStream", function() {
105406
+ return { getVideoTracks: () => [] };
105407
+ }));
105408
+ }
105409
+ const tracks = video.textTracks;
105410
+ const savedModes = [];
105411
+ for (let i = 0; i < tracks.length; i++) {
105412
+ savedModes.push(tracks[i].mode);
105413
+ tracks[i].mode = "disabled";
105414
+ }
105415
+ undos.push(() => {
105416
+ const t = video.textTracks;
105417
+ for (let i = 0; i < t.length && i < savedModes.length; i++)
105418
+ t[i].mode = savedModes[i];
105419
+ });
105420
+ videoUndos.set(video, undos);
105421
+ }
105422
+ function unlockVideo(video) {
105423
+ const undos = videoUndos.get(video);
105424
+ if (!undos)
105425
+ return;
105426
+ videoUndos.delete(video);
105427
+ runUndos(undos);
105428
+ }
105429
+ function lockCaption(c) {
105430
+ if (captionUndos.has(c))
105431
+ return;
105432
+ const undos = [];
105433
+ while (c.firstChild)
105434
+ c.removeChild(c.firstChild);
105435
+ undos.push(overrideOwn(c, "appendChild", (n) => n));
105436
+ undos.push(overrideOwn(c, "insertBefore", (n) => n));
105437
+ undos.push(overrideOwn(c, "insertAdjacentHTML", () => {
105438
+ }));
105439
+ undos.push(overrideOwn(c, "insertAdjacentElement", (_pos, n) => n));
105440
+ try {
105441
+ Object.defineProperty(c, "innerHTML", {
105442
+ configurable: true,
105443
+ get: () => "",
105444
+ set: () => {
105445
+ }
105446
+ });
105447
+ undos.push(() => {
105448
+ try {
105449
+ delete c.innerHTML;
105450
+ } catch (_) {
105451
+ }
105452
+ });
105453
+ } catch (_) {
105454
+ }
105455
+ captionUndos.set(c, undos);
105456
+ }
105457
+ function unlockCaption(c) {
105458
+ const undos = captionUndos.get(c);
105459
+ if (!undos)
105460
+ return;
105461
+ captionUndos.delete(c);
105462
+ runUndos(undos);
105463
+ }
105464
+ function snapshotPlayers() {
105465
+ walkVideos(document, (video) => {
105466
+ const playerEl = video.closest("video-js, [data-vjs-player], .video-js");
105467
+ playerSnapshots.push({
105468
+ video,
105469
+ paused: video.paused,
105470
+ currentTime: video.currentTime,
105471
+ playerEl,
105472
+ playerClasses: playerEl ? Array.from(playerEl.classList) : []
105473
+ });
105474
+ });
105475
+ }
105476
+ function restorePlayers() {
105477
+ for (let i = 0; i < playerSnapshots.length; i++) {
105478
+ const s = playerSnapshots[i];
105479
+ if (s.paused && !s.video.paused) {
105480
+ s.video.pause();
105481
+ try {
105482
+ s.video.currentTime = s.currentTime;
105483
+ } catch (_) {
105484
+ }
105485
+ }
105486
+ if (s.playerEl) {
105487
+ const current = Array.from(s.playerEl.classList);
105488
+ for (let j = 0; j < current.length; j++) {
105489
+ if (s.playerClasses.indexOf(current[j]) === -1)
105490
+ s.playerEl.classList.remove(current[j]);
105491
+ }
105492
+ for (let j = 0; j < s.playerClasses.length; j++)
105493
+ s.playerEl.classList.add(s.playerClasses[j]);
105494
+ }
105495
+ }
105496
+ }
105497
+ function patchGlobals() {
105498
+ ;
105499
+ HTMLMediaElement.prototype.play = function() {
105500
+ return Promise.resolve();
105501
+ };
105502
+ document.createElement = function(tag) {
105503
+ const el = originalCreateElement(tag);
105504
+ if (typeof tag === "string" && tag.toLowerCase() === "video") {
105505
+ lockVideo(el);
105506
+ }
105507
+ return el;
105508
+ };
105509
+ document.createElementNS = function(nsArg, tag) {
105510
+ const el = originalCreateElementNS(nsArg, tag);
105511
+ if (typeof tag === "string" && tag.toLowerCase() === "video") {
105512
+ lockVideo(el);
105513
+ }
105514
+ return el;
105515
+ };
105516
+ }
105517
+ function unpatchGlobals() {
105518
+ ;
105519
+ HTMLMediaElement.prototype.play = originalProtoPlay;
105520
+ document.createElement = originalCreateElement;
105521
+ document.createElementNS = originalCreateElementNS;
105522
+ }
105523
+ function startObserver() {
105524
+ observer = new MutationObserver((mutations) => {
105525
+ for (let i = 0; i < mutations.length; i++) {
105526
+ const added = mutations[i].addedNodes;
105527
+ for (let j = 0; j < added.length; j++) {
105528
+ const node = added[j];
105529
+ if (!(node instanceof Element))
105530
+ continue;
105531
+ if (node.tagName === "VIDEO")
105532
+ lockVideo(node);
105533
+ else if (node.classList && node.classList.contains("vjs-text-track-display"))
105534
+ lockCaption(node);
105535
+ walkVideos(node, lockVideo);
105536
+ walkCaptions(node, lockCaption);
105537
+ }
105538
+ }
105539
+ });
105540
+ observer.observe(document, { childList: true, subtree: true });
105541
+ }
105542
+ function stopObserver() {
105543
+ if (observer) {
105544
+ observer.disconnect();
105545
+ observer = null;
105546
+ }
105547
+ }
105548
+ patchGlobals();
105549
+ walkCaptions(document, lockCaption);
105550
+ startObserver();
105551
+ w[ns] = {
105552
+ // `setup` is already complete by the time we get here; the no-op handler keeps the dispatch shape uniform.
105553
+ setup() {
105554
+ },
105555
+ beforeResize() {
105556
+ walkVideos(document, lockVideo);
105557
+ walkCaptions(document, lockCaption);
105558
+ },
105559
+ beforeSnapshot() {
105560
+ walkVideos(document, (video) => {
105561
+ if (!video.paused)
105562
+ video.pause();
105563
+ const t = video.textTracks;
105564
+ for (let i = 0; i < t.length; i++)
105565
+ t[i].mode = "disabled";
105566
+ });
105567
+ playerSnapshots.length = 0;
105568
+ snapshotPlayers();
105569
+ walkCaptions(document, lockCaption);
105570
+ },
105571
+ afterSnapshot() {
105572
+ walkVideos(document, unlockVideo);
105573
+ restorePlayers();
105574
+ playerSnapshots.length = 0;
105575
+ },
105576
+ teardown() {
105577
+ restorePlayers();
105578
+ stopObserver();
105579
+ unpatchGlobals();
105580
+ walkVideos(document, unlockVideo);
105581
+ walkCaptions(document, unlockCaption);
105582
+ delete w[ns];
105583
+ }
105584
+ };
105585
+ }
105586
+ }
105587
+ exports.pagePayload = pagePayload;
105588
+ }
105589
+ });
105590
+
105286
105591
  // ../core/dist/ufg/utils/take-dom-snapshots.js
105287
105592
  var require_take_dom_snapshots = __commonJS({
105288
105593
  "../core/dist/ufg/utils/take-dom-snapshots.js"(exports) {
@@ -105338,6 +105643,7 @@ var require_take_dom_snapshots = __commonJS({
105338
105643
  var generate_safe_selectors_1 = require_generate_safe_selectors();
105339
105644
  var wait_for_lazy_load_1 = require_wait_for_lazy_load();
105340
105645
  var calculate_required_sizes_1 = require_calculate_required_sizes();
105646
+ var media_playback_guard_1 = require_media_playback_guard();
105341
105647
  var chalk_1 = __importDefault(require_source());
105342
105648
  var utils2 = __importStar(require_browser3());
105343
105649
  var lang = __importStar(require_lang());
@@ -105387,9 +105693,12 @@ var require_take_dom_snapshots = __commonJS({
105387
105693
  context: currentContext,
105388
105694
  elementReferences: settings.elementReferences
105389
105695
  });
105696
+ const mediaGuard = (0, media_playback_guard_1.makeMediaPlaybackGuard)({ context: currentContext, logger });
105697
+ await mediaGuard.setup();
105390
105698
  const snapshots = Array(settings.environments.length);
105391
105699
  for (const [index, { viewportSize, browsers }] of entries.entries()) {
105392
105700
  logger.log(`Taking dom snapshot for viewport size ${viewportSize}`);
105701
+ await mediaGuard.beforeResize();
105393
105702
  if (viewportSize) {
105394
105703
  try {
105395
105704
  await driver.setViewportSize(viewportSize);
@@ -105421,10 +105730,13 @@ var require_take_dom_snapshots = __commonJS({
105421
105730
  await (0, wait_for_lazy_load_1.waitForLazyLoad)({ context: currentContext, settings: settings.lazyLoad, logger });
105422
105731
  }
105423
105732
  await beforeEachSnapshot();
105733
+ await mediaGuard.beforeSnapshot();
105424
105734
  const snapshot = await (0, take_dom_snapshot_1.takeDomSnapshot)({ context: currentContext, settings, logger });
105425
105735
  browsers.forEach(({ index: index2 }) => snapshots[index2] = snapshot);
105736
+ await mediaGuard.afterSnapshot();
105426
105737
  }
105427
105738
  await driver.setViewportSize(initialViewportSize);
105739
+ await mediaGuard.teardown();
105428
105740
  if (settings.layoutBreakpoints.reload) {
105429
105741
  await driver.reloadPage();
105430
105742
  await beforeEachSnapshot();
@@ -106314,11 +106626,11 @@ var require_requests3 = __commonJS({
106314
106626
  return pathSelector;
106315
106627
  }
106316
106628
  function trimValueForResource(resource) {
106629
+ const { logger: _logger, ...rest } = resource;
106317
106630
  if ("value" in resource) {
106318
- return { ...resource, value: resource.value.subarray(0, 100), byteLength: resource.value.byteLength };
106319
- } else {
106320
- return resource;
106631
+ return { ...rest, value: resource.value.subarray(0, 100), byteLength: resource.value.byteLength };
106321
106632
  }
106633
+ return rest;
106322
106634
  }
106323
106635
  }
106324
106636
  });
@@ -129811,7 +130123,7 @@ var require_open_eyes4 = __commonJS({
129811
130123
  logger
129812
130124
  });
129813
130125
  if (settings.disableBrokerUrlCache && driver) {
129814
- await core.clearNMLClientCache(driver);
130126
+ await core.disableNMLClientCache(driver);
129815
130127
  }
129816
130128
  const getTypedEyes = (0, get_typed_eyes_1.makeGetTypedEyes)({
129817
130129
  type,
@@ -130496,7 +130808,7 @@ var require_package3 = __commonJS({
130496
130808
  "../core/package.json"(exports, module) {
130497
130809
  module.exports = {
130498
130810
  name: "@applitools/core",
130499
- version: "4.63.0",
130811
+ version: "4.63.1",
130500
130812
  homepage: "https://applitools.com",
130501
130813
  bugs: {
130502
130814
  url: "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -132047,7 +132359,7 @@ var require_package4 = __commonJS({
132047
132359
  "../eyes/package.json"(exports, module) {
132048
132360
  module.exports = {
132049
132361
  name: "@applitools/eyes",
132050
- version: "1.42.0",
132362
+ version: "1.42.1",
132051
132363
  keywords: [
132052
132364
  "applitools",
132053
132365
  "eyes",
@@ -133663,7 +133975,7 @@ var require_package5 = __commonJS({
133663
133975
  "package.json"(exports, module) {
133664
133976
  module.exports = {
133665
133977
  name: "@applitools/eyes-browser",
133666
- version: "1.6.17",
133978
+ version: "1.6.18",
133667
133979
  type: "module",
133668
133980
  keywords: [
133669
133981
  "applitools",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-browser",
3
- "version": "1.6.17",
3
+ "version": "1.6.18",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "applitools",
@@ -51,10 +51,10 @@
51
51
  "test": "run playwright test"
52
52
  },
53
53
  "dependencies": {
54
- "@applitools/eyes": "1.42.0"
54
+ "@applitools/eyes": "1.42.1"
55
55
  },
56
56
  "devDependencies": {
57
- "@applitools/test-server": "1.4.3",
57
+ "@applitools/test-server": "1.4.4",
58
58
  "@playwright/test": "1.55.1",
59
59
  "@types/node": "^12.20.55",
60
60
  "@types/path-browserify": "^1.0.1",