@e2e-dev/web 0.15.4-nightly-20261030030232 → 0.15.4

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/.build.json CHANGED
@@ -1 +1 @@
1
- {"version":"0.15.4-nightly-20261030030232"}
1
+ {"version":"0.15.4"}
@@ -42,7 +42,7 @@ export async function registerCdpSelectors(context, budget) {
42
42
  export async function requireCdpShadowTracking(page, budget) {
43
43
  if (budget.signal.aborted)
44
44
  throw connectionAbort(budget.signal, 'CDP tracking verification');
45
- const tracked = await Promise.all(page.frames().map((frame) => frame.evaluate((key) => Reflect.get(globalThis, Symbol.for(key)) instanceof WeakMap, CLOSED_SHADOW_ROOTS_KEY)));
45
+ const tracked = await Promise.all(page.frames().map((frame) => frame.evaluate((key) => Symbol.for(key) in globalThis, CLOSED_SHADOW_ROOTS_KEY)));
46
46
  if (budget.signal.aborted)
47
47
  throw connectionAbort(budget.signal, 'CDP tracking verification');
48
48
  if (tracked.some((present) => !present)) {
@@ -53,7 +53,10 @@ export declare const SEARCH_ROOTS_SELECTOR_ENGINE = "e2e-roots";
53
53
  * reached from exactly one root. A document that has attached no closed root
54
54
  * (the record's `count` is zero) has none to find, and the walk over every
55
55
  * element is skipped; every locator resolution runs this, so a page without
56
- * closed roots must pay nothing for the reach.
56
+ * closed roots must pay nothing for the reach. The record counts as present
57
+ * when the init script defined it on the global, checked with `in` because
58
+ * it calls nothing the page can replace: `instanceof WeakMap` reads the
59
+ * page's own `WeakMap`, which a polyfill may swap out.
57
60
  */
58
61
  export declare const CLOSED_SHADOW_HELPERS_SOURCE: string;
59
62
  /** The two closed-root selector engines; `selector-engines.ts` lists them with the label engine for registration. */
@@ -68,11 +68,15 @@ export const SEARCH_ROOTS_SELECTOR_ENGINE = 'e2e-roots';
68
68
  * reached from exactly one root. A document that has attached no closed root
69
69
  * (the record's `count` is zero) has none to find, and the walk over every
70
70
  * element is skipped; every locator resolution runs this, so a page without
71
- * closed roots must pay nothing for the reach.
71
+ * closed roots must pay nothing for the reach. The record counts as present
72
+ * when the init script defined it on the global, checked with `in` because
73
+ * it calls nothing the page can replace: `instanceof WeakMap` reads the
74
+ * page's own `WeakMap`, which a polyfill may swap out.
72
75
  */
73
76
  export const CLOSED_SHADOW_HELPERS_SOURCE = `
74
- const roots = globalThis[Symbol.for(${JSON.stringify(CLOSED_SHADOW_ROOTS_KEY)})];
75
- const tracked = roots instanceof WeakMap;
77
+ const key = Symbol.for(${JSON.stringify(CLOSED_SHADOW_ROOTS_KEY)});
78
+ const tracked = key in globalThis;
79
+ const roots = globalThis[key];
76
80
  const closedRootsUnder = (root, out) => {
77
81
  if (!tracked || roots.count === 0) return out;
78
82
  const scan = (el) => {
@@ -26,8 +26,8 @@ function hideCaret() {
26
26
  roots.push(root);
27
27
  root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];
28
28
  for (const element of root.querySelectorAll('*')) {
29
- const shadow = element.shadowRoot ?? (closed instanceof WeakMap ? closed.get(element) : null);
30
- if (shadow instanceof ShadowRoot)
29
+ const shadow = element.shadowRoot ?? closed?.get(element);
30
+ if (shadow !== null && shadow !== undefined)
31
31
  visit(shadow);
32
32
  }
33
33
  };
package/dist/surface.js CHANGED
@@ -662,7 +662,7 @@ export class PlaywrightSurface {
662
662
  const recorded = Reflect.get(globalThis, Symbol.for(key));
663
663
  let active = document.activeElement;
664
664
  while (active !== null) {
665
- const root = active.shadowRoot ?? (recorded instanceof WeakMap ? recorded.get(active) : undefined);
665
+ const root = active.shadowRoot ?? recorded?.get(active);
666
666
  const leaf = root?.activeElement;
667
667
  if (leaf === undefined || leaf === null)
668
668
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e2e-dev/web",
3
- "version": "0.15.4-nightly-20261030030232",
3
+ "version": "0.15.4",
4
4
  "description": "Web engine for e2e agentic end-to-end testing, built on Playwright",
5
5
  "keywords": [
6
6
  "e2e",
@@ -50,11 +50,11 @@
50
50
  "playwright-core": "1.64.1"
51
51
  },
52
52
  "peerDependencies": {
53
- "e2e": "0.22.0-nightly-20261030030232"
53
+ "e2e": ">=0.18.0 <1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "26.6.5",
57
- "e2e": "0.22.0-nightly-20261030030232",
57
+ "e2e": "0.22.0",
58
58
  "@types/pngjs": "6.0.5",
59
59
  "pngjs": "7.0.0",
60
60
  "typescript": "7.0.2",