@applitools/spec-driver-playwright 1.8.5 → 1.9.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.1](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-playwright@1.9.0...js/spec-driver-playwright@1.9.1) (2026-05-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * address CI regressions from executeBrowserCommands and Chromium 140+ service worker ([#3848](https://github.com/Applitools-Dev/sdk/issues/3848)) ([099ada5](https://github.com/Applitools-Dev/sdk/commit/099ada5e52d4153157b98c2203df428579527e49))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/snippets bumped to 2.9.1
14
+ #### Bug Fixes
15
+
16
+ * declare @babel/preset-typescript dep for sandbox build ([#3815](https://github.com/Applitools-Dev/sdk/issues/3815)) ([10c44c6](https://github.com/Applitools-Dev/sdk/commit/10c44c66635f1ed4e0361f22ecebf2221c2cc912))
17
+ * @applitools/driver bumped to 1.26.1
18
+ #### Bug Fixes
19
+
20
+ * address CI regressions from executeBrowserCommands and Chromium 140+ service worker ([#3848](https://github.com/Applitools-Dev/sdk/issues/3848)) ([099ada5](https://github.com/Applitools-Dev/sdk/commit/099ada5e52d4153157b98c2203df428579527e49))
21
+
22
+
23
+
24
+
25
+ ## [1.9.0](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-playwright@1.8.5...js/spec-driver-playwright@1.9.0) (2026-05-05)
26
+
27
+
28
+ ### Features
29
+
30
+ * add bypassCSP support for UFG snapshot capture ([#3783](https://github.com/Applitools-Dev/sdk/issues/3783)) ([9e98933](https://github.com/Applitools-Dev/sdk/commit/9e98933b8ffba2ad1928aa2b2110e9a25209a599))
31
+
32
+
33
+ ### Dependencies
34
+
35
+ * @applitools/dom-shared bumped to 1.2.0
36
+ #### Features
37
+
38
+ * add bypassCSP support for UFG snapshot capture ([#3783](https://github.com/Applitools-Dev/sdk/issues/3783)) ([9e98933](https://github.com/Applitools-Dev/sdk/commit/9e98933b8ffba2ad1928aa2b2110e9a25209a599))
39
+ * @applitools/snippets bumped to 2.9.0
40
+ #### Features
41
+
42
+ * add bypassCSP support for UFG snapshot capture ([#3783](https://github.com/Applitools-Dev/sdk/issues/3783)) ([9e98933](https://github.com/Applitools-Dev/sdk/commit/9e98933b8ffba2ad1928aa2b2110e9a25209a599))
43
+
44
+
45
+
46
+ * @applitools/driver bumped to 1.26.0
47
+ #### Features
48
+
49
+ * add bypassCSP support for UFG snapshot capture ([#3783](https://github.com/Applitools-Dev/sdk/issues/3783)) ([9e98933](https://github.com/Applitools-Dev/sdk/commit/9e98933b8ffba2ad1928aa2b2110e9a25209a599))
50
+
51
+
52
+
53
+
3
54
  ## [1.8.5](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-playwright@1.8.4...js/spec-driver-playwright@1.8.5) (2026-04-16)
4
55
 
5
56
 
@@ -48,28 +48,33 @@ async function handleToObject(handle) {
48
48
  return handle.jsonValue();
49
49
  }
50
50
  }
51
+ // Playwright 1.60 renamed its public classes with a leading underscore (Page → _Page,
52
+ // Frame → _Frame, etc.). Accept both so the SDK works on Playwright >=1.0 <1.60 and >=1.60.
53
+ function isPwInstanceOf(value, name) {
54
+ return utils.types.instanceOf(value, name) || utils.types.instanceOf(value, `_${name}`);
55
+ }
51
56
  function isDriver(page) {
52
57
  if (!page)
53
58
  return false;
54
- return utils.types.instanceOf(page, 'Page');
59
+ return isPwInstanceOf(page, 'Page');
55
60
  }
56
61
  exports.isDriver = isDriver;
57
62
  function isContext(frame) {
58
63
  if (!frame)
59
64
  return false;
60
- return utils.types.instanceOf(frame, 'Frame');
65
+ return isPwInstanceOf(frame, 'Frame');
61
66
  }
62
67
  exports.isContext = isContext;
63
68
  function isElement(element) {
64
69
  if (!element)
65
70
  return false;
66
- return utils.types.instanceOf(element, 'ElementHandle');
71
+ return isPwInstanceOf(element, 'ElementHandle');
67
72
  }
68
73
  exports.isElement = isElement;
69
74
  function isSelector(selector) {
70
75
  if (!selector)
71
76
  return false;
72
- return utils.types.isString(selector) || utils.types.instanceOf(selector, 'Locator');
77
+ return utils.types.isString(selector) || isPwInstanceOf(selector, 'Locator');
73
78
  }
74
79
  exports.isSelector = isSelector;
75
80
  function isStaleElementError(err) {
@@ -92,10 +97,10 @@ function toSelector(selector) {
92
97
  }
93
98
  exports.toSelector = toSelector;
94
99
  function toSimpleCommonSelector(selector) {
95
- if (utils.types.instanceOf(selector, 'Locator')) {
100
+ if (isPwInstanceOf(selector, 'Locator')) {
96
101
  selector = selector._selector;
97
102
  }
98
- else if (utils.types.instanceOf(selector, 'FrameLocator')) {
103
+ else if (isPwInstanceOf(selector, 'FrameLocator')) {
99
104
  selector = selector._frameSelector;
100
105
  }
101
106
  return utils.types.isString(selector) ? { selector } : null;
@@ -123,6 +128,19 @@ async function executeBrowserCommands(page, commands, logger) {
123
128
  });
124
129
  }
125
130
  break;
131
+ case 'Page.setBypassCSP':
132
+ if (currentCommand.params) {
133
+ const browser = page.context().browser();
134
+ if ((browser === null || browser === void 0 ? void 0 : browser.browserType().name()) === 'chromium') {
135
+ // Keep the session open — Page.setBypassCSP is session-scoped in Chrome
136
+ const bypassSession = await page.context().newCDPSession(page);
137
+ await bypassSession.send('Page.setBypassCSP', currentCommand.params);
138
+ }
139
+ else {
140
+ logger === null || logger === void 0 ? void 0 : logger.info('Page.setBypassCSP not supported on this browser');
141
+ }
142
+ }
143
+ break;
126
144
  default:
127
145
  native = false;
128
146
  const browser = page.context().browser();
@@ -140,7 +158,7 @@ async function executeBrowserCommands(page, commands, logger) {
140
158
  }
141
159
  exports.executeBrowserCommands = executeBrowserCommands;
142
160
  async function findElement(frame, selector, parent) {
143
- if (utils.types.instanceOf(selector, 'Locator')) {
161
+ if (isPwInstanceOf(selector, 'Locator')) {
144
162
  return selector.elementHandle();
145
163
  }
146
164
  const root = parent !== null && parent !== void 0 ? parent : frame;
@@ -148,7 +166,7 @@ async function findElement(frame, selector, parent) {
148
166
  }
149
167
  exports.findElement = findElement;
150
168
  async function findElements(frame, selector, parent) {
151
- if (utils.types.instanceOf(selector, 'Locator')) {
169
+ if (isPwInstanceOf(selector, 'Locator')) {
152
170
  return (await selector.elementHandles());
153
171
  }
154
172
  const root = parent !== null && parent !== void 0 ? parent : frame;
@@ -273,7 +291,9 @@ async function build(env) {
273
291
  }
274
292
  }
275
293
  // TODO remove this once Playwright provides formal support for headless: 'new' (https://github.com/microsoft/playwright/issues/21194)
276
- if (headless) {
294
+ // Skip --headless=new when loading a Chrome extension: Chromium's new headless mode does not reliably
295
+ // load MV3 extensions, so fall back to Playwright's default behavior when `extension` is set.
296
+ if (headless && !extension) {
277
297
  options.args.push('--headless=new');
278
298
  delete options.headless;
279
299
  options.ignoreDefaultArgs.push('--headless');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/spec-driver-playwright",
3
- "version": "1.8.5",
3
+ "version": "1.9.1",
4
4
  "keywords": [
5
5
  "playwright",
6
6
  "chrome devtools protocol",
@@ -40,7 +40,7 @@
40
40
  "up:framework": "echo \"$(jq '.devDependencies.playwright = $ENV.APPLITOOLS_FRAMEWORK_VERSION' ./package.json)\" > ./package.json"
41
41
  },
42
42
  "dependencies": {
43
- "@applitools/driver": "1.25.5",
43
+ "@applitools/driver": "1.26.1",
44
44
  "@applitools/utils": "1.14.4"
45
45
  },
46
46
  "devDependencies": {