@glubean/browser 0.8.4 → 0.9.0

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/evidence.js CHANGED
@@ -8,12 +8,17 @@
8
8
  * trace event (see {@link ./network.ts}).
9
9
  * - **Request mock** (`Fetch` domain) — fulfill matching requests with a canned
10
10
  * response; non-matching requests are continued untouched.
11
- * - **Emulation** (`Emulation` domain) — timezone / geolocation / viewport.
11
+ * - **Emulation** (`Emulation` domain) — timezone / geolocation / viewport / user agent.
12
+ * - **Storage state** — restore cookies / localStorage before the page's
13
+ * first script runs, and capture them back out on demand (a thin "login
14
+ * once, reuse the session" primitive). Cookies go through this session's
15
+ * `Network.setCookies` (browser-context scoped, session-agnostic in CDP).
16
+ * localStorage does **not** — see guardrail ③.
12
17
  *
13
18
  * The keystone spike disproved the "Fetch is near-exclusive" hypothesis: a
14
19
  * self-opened session running `Fetch.enable`/`fulfillRequest` is stable **as
15
20
  * long as the user has not enabled Puppeteer's own request interception**.
16
- * Two coexistence hazards remain, each handled by a guardrail below:
21
+ * Three coexistence hazards exist, each handled below:
17
22
  *
18
23
  * **Guardrail ① — viewport ownership.** Our `Emulation.setDeviceMetricsOverride`
19
24
  * and Puppeteer's `page.setViewport()` both drive device metrics and clobber
@@ -28,6 +33,45 @@
28
33
  * `page.setRequestInterception(true)` with a clear error. When no mocks are
29
34
  * configured we never enable `Fetch`, so the user's own interception is free.
30
35
  *
36
+ * **Guardrail ③ — new-document scripts need Puppeteer's OWN session.**
37
+ * Verified empirically: sending `Page.addScriptToEvaluateOnNewDocument` on
38
+ * our *auxiliary* `page.createCDPSession()` session registers without error
39
+ * (a real `identifier` comes back) but the script never actually fires on
40
+ * subsequent navigations — only the session Puppeteer itself uses for the
41
+ * page's frame-lifecycle bookkeeping gets its new-document scripts run.
42
+ * `storageState.localStorage` therefore seeds via Puppeteer's own
43
+ * `page.evaluateOnNewDocument()`, not a raw CDP call on this session.
44
+ *
45
+ * **Downloads** (`Browser` domain, BT1-M5) — `Browser.setDownloadBehavior`
46
+ * with `eventsEnabled: true`, called on this same auxiliary session, both
47
+ * configures the save directory AND (unlike guardrail ③'s Page-domain
48
+ * finding) reliably delivers `Browser.downloadWillBegin` /
49
+ * `Browser.downloadProgress` back on THIS session — verified empirically
50
+ * (spike script) against puppeteer-core ^24; `Browser.*` is genuinely
51
+ * session-agnostic where `Page.addScriptToEvaluateOnNewDocument` was not.
52
+ * The deprecated `Page.setDownloadBehavior` / `Page.downloadWillBegin` also
53
+ * work on the same spike but `Browser.*` is the protocol's forward path, so
54
+ * that's what's wired here. One caveat verified in the same spike: the file
55
+ * on disk is saved as `suggestedFilename`, not `guid` (despite some CDP docs
56
+ * implying the latter) — `DownloadEntry.path` is built from that name, which
57
+ * is only exact when Chrome didn't have to de-duplicate a collision.
58
+ * Always wired when a page is created (like dialog/popup) — a download IS
59
+ * evidence the moment it happens, not an opt-in capability.
60
+ *
61
+ * **Guardrail ④ — download events are browser-context-global.** Unlike the
62
+ * page-scoped `Network`/`Fetch` domains, `Browser.setDownloadBehavior` sets a
63
+ * single context-wide save path (last caller wins) and its `downloadWillBegin`/
64
+ * `downloadProgress` events fire on *every* session that turned events on, for
65
+ * *every* download in the context. So two instrumented pages in one Chrome
66
+ * would otherwise cross-observe and cross-repoint each other's downloads. Two
67
+ * mitigations: (a) the page layer uses ONE browser-wide download dir (not
68
+ * per-test) so the last-wins path is a no-op; (b) this session enables the
69
+ * `Page` domain, tracks its target's frame ids (`Page.getFrameTree` +
70
+ * `frameAttached`/`frameDetached`), and only records downloads whose
71
+ * originating `frameId` it owns — so a page never resolves another page's
72
+ * download. Both degrade safely: an unreadable frame tree falls back to
73
+ * accepting all events (single-page runs are unaffected).
74
+ *
31
75
  * @module evidence
32
76
  */
33
77
  import { attachNetworkTracer, } from "./network.js";
@@ -39,12 +83,26 @@ export function matchMock(rule, req) {
39
83
  }
40
84
  if (typeof rule.url === "string")
41
85
  return req.url.includes(rule.url);
42
- // Test against a stateless clone: a user-supplied global/sticky regex
43
- // (`/g`, `/y`) carries `lastIndex` state, so `.test()` on the original would
44
- // flip-flop matches for the same URL across repeated requests (and would also
45
- // mutate the caller's regex). Strip `g`/`y` on a copy to keep matching pure.
46
- const stateless = new RegExp(rule.url.source, rule.url.flags.replace(/[gy]/g, ""));
47
- return stateless.test(req.url);
86
+ // Test against a freshly-constructed clone that carries the SAME flags as
87
+ // `rule.url`, including `g`/`y`: a global/sticky regex carries `lastIndex`
88
+ // state, so `.test()` on the caller's own object would flip-flop matches
89
+ // for the same URL across repeated requests (and would mutate the caller's
90
+ // regex). A same-flags clone fixes that statelessness — it always starts
91
+ // at `lastIndex: 0` and is discarded after this call, so no state ever
92
+ // crosses requests or leaks back into `rule.url`.
93
+ //
94
+ // Earlier this also *stripped* `g`/`y` on the clone, which went further
95
+ // than the statelessness fix required: dropping `y` silently discards a
96
+ // sticky regex's anchoring semantics — `.test()` on a `/y` regex only
97
+ // matches when the pattern occurs starting exactly at `lastIndex` (0 here,
98
+ // i.e. the start of the string), whereas a plain (non-sticky) regex
99
+ // matches anywhere in the string. Stripping `y` therefore turned an
100
+ // anchored mock pattern into an unanchored substring search, which could
101
+ // make a sticky mock rule match URLs it was never meant to (GLU-73).
102
+ // Preserving the original flags on the clone keeps `.test()` behaving
103
+ // exactly as it would on a fresh copy of the caller's own regex.
104
+ const clone = new RegExp(rule.url.source, rule.url.flags);
105
+ return clone.test(req.url);
48
106
  }
49
107
  /** @internal Find the first matching mock rule, or `undefined`. */
50
108
  export function findMock(mocks, req) {
@@ -88,8 +146,9 @@ export function buildFulfillParams(rule, requestId) {
88
146
  /**
89
147
  * @internal Build the ordered list of `Emulation.*` CDP calls.
90
148
  *
91
- * Timezone and geolocation come first; the viewport override is applied **last**
92
- * (guardrail ①) so it is the final word on device metrics at setup time.
149
+ * Timezone, geolocation, and user agent come first (order-independent among
150
+ * themselves); the viewport override is applied **last** (guardrail ①) so it
151
+ * is the final word on device metrics at setup time.
93
152
  */
94
153
  export function buildEmulationCalls(emulate) {
95
154
  const calls = [];
@@ -106,6 +165,12 @@ export function buildEmulationCalls(emulate) {
106
165
  params: { latitude, longitude, accuracy: accuracy ?? 0 },
107
166
  });
108
167
  }
168
+ if (emulate.userAgent !== undefined) {
169
+ calls.push({
170
+ method: "Emulation.setUserAgentOverride",
171
+ params: { userAgent: emulate.userAgent },
172
+ });
173
+ }
109
174
  if (emulate.viewport) {
110
175
  const { width, height, deviceScaleFactor, mobile } = emulate.viewport;
111
176
  calls.push({
@@ -120,6 +185,15 @@ export function buildEmulationCalls(emulate) {
120
185
  }
121
186
  return calls;
122
187
  }
188
+ /**
189
+ * @internal Build `Network.setCookies` params from `storageState.cookies`.
190
+ * Returns `undefined` when there is nothing to set (caller skips the call).
191
+ */
192
+ export function buildSetCookiesParams(cookies) {
193
+ if (!cookies || cookies.length === 0)
194
+ return undefined;
195
+ return { cookies };
196
+ }
123
197
  /**
124
198
  * @internal Replace `page[method]` with a guard, returning a restore function.
125
199
  *
@@ -162,6 +236,29 @@ export class EvidenceSession {
162
236
  _screenshotOpts;
163
237
  _screenshotSeq = 0;
164
238
  _screenshotLog = [];
239
+ // ── Download state ───────────────────────────────────────────────
240
+ _downloadsEnabled = false;
241
+ _downloadDir;
242
+ _onDownload;
243
+ /**
244
+ * Frame ids owned by THIS page's target. `Browser.setDownloadBehavior`'s
245
+ * events are browser-context-global — every session that turned events on
246
+ * receives every download in the context. We only record downloads whose
247
+ * originating `frameId` belongs to this page, so two instrumented pages
248
+ * sharing one Chrome never cross-observe each other's downloads.
249
+ */
250
+ _ownedFrames = new Set();
251
+ /**
252
+ * True only once the initial `Page.getFrameTree` seeded {@link _ownedFrames}.
253
+ * The frame filter engages ONLY when this is set — otherwise we accept all
254
+ * download events (fallback mode). Without this flag, a later
255
+ * `Page.frameAttached` would grow `_ownedFrames` from empty to non-empty and
256
+ * silently flip fallback mode into a PARTIAL filter that drops the page's own
257
+ * top-frame downloads (codex R2 P2).
258
+ */
259
+ _frameTreeSeeded = false;
260
+ _pendingDownloads = new Map();
261
+ _downloadWaiters = [];
165
262
  constructor(cdp) {
166
263
  this._cdp = cdp;
167
264
  }
@@ -220,10 +317,10 @@ export class EvidenceSession {
220
317
  }
221
318
  /**
222
319
  * Open one CDP session on `page` and wire up the requested capabilities:
223
- * Network trace, Fetch mock (guardrail ②), and Emulation (guardrail ① for
224
- * viewport). Capabilities are only enabled when their config is present, so a
225
- * page with no mocks never enables `Fetch` and leaves the user's own request
226
- * interception untouched.
320
+ * Network trace, Fetch mock (guardrail ②), Emulation (guardrail ① for
321
+ * viewport), and storage state (cookies + localStorage). Capabilities are
322
+ * only enabled when their config is present, so a page with no mocks never
323
+ * enables `Fetch` and leaves the user's own request interception untouched.
227
324
  */
228
325
  static async attach(page, options) {
229
326
  const cdp = await page.createCDPSession();
@@ -251,7 +348,7 @@ export class EvidenceSession {
251
348
  if (mocks && mocks.length > 0) {
252
349
  await session._installMocks(page, mocks);
253
350
  }
254
- // 3. Emulation (timezone / geolocation) + viewport last (guardrail ①).
351
+ // 3. Emulation (timezone / geolocation / user agent) + viewport last (guardrail ①).
255
352
  if (options.emulate) {
256
353
  for (const call of buildEmulationCalls(options.emulate)) {
257
354
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -261,6 +358,15 @@ export class EvidenceSession {
261
358
  session._guardViewport(page);
262
359
  }
263
360
  }
361
+ // 4. Storage state — cookies + localStorage restored before the page's
362
+ // first script runs. Order-independent from the other capabilities.
363
+ if (options.storageState) {
364
+ await session._applyStorageState(page, options.storageState);
365
+ }
366
+ // 5. Downloads — see the module doc's Downloads note. Order-independent.
367
+ if (options.downloads) {
368
+ await session._enableDownloads(options.downloads);
369
+ }
264
370
  }
265
371
  catch (err) {
266
372
  // Roll back any partial wiring so we never leak a half-open session.
@@ -305,6 +411,278 @@ export class EvidenceSession {
305
411
  this._cdp.off("Fetch.requestPaused", onPaused);
306
412
  });
307
413
  }
414
+ async _applyStorageState(page, state) {
415
+ // Cookies are browser-context scoped in CDP, so our auxiliary session
416
+ // sets them fine (`Network.setCookies` isn't tied to a particular
417
+ // DevTools session/target the way frame-lifecycle hooks are).
418
+ const cookieParams = buildSetCookiesParams(state.cookies);
419
+ if (cookieParams) {
420
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
421
+ await this._cdp.send("Network.setCookies", cookieParams);
422
+ }
423
+ // localStorage seeding, in contrast, MUST go through Puppeteer's own
424
+ // page.evaluateOnNewDocument() — sending the equivalent raw
425
+ // `Page.addScriptToEvaluateOnNewDocument` on our *auxiliary*
426
+ // `page.createCDPSession()` session silently registers (no error, a
427
+ // real `identifier` comes back) but never actually fires on subsequent
428
+ // navigations. Verified empirically (spike script) against puppeteer-core
429
+ // ^24/^25: only the session Puppeteer itself uses for the page's own
430
+ // frame-lifecycle bookkeeping gets its new-document scripts run — a
431
+ // second, independently-attached session's registration is a no-op.
432
+ // Puppeteer's own API owns that session, so route through it here.
433
+ if (state.localStorage && Object.keys(state.localStorage).length > 0) {
434
+ const entries = state.localStorage;
435
+ await page.evaluateOnNewDocument((seed) => {
436
+ for (const [k, v] of Object.entries(seed)) {
437
+ try {
438
+ localStorage.setItem(k, v);
439
+ }
440
+ catch {
441
+ // best-effort — e.g. storage quota exceeded
442
+ }
443
+ }
444
+ }, entries);
445
+ }
446
+ }
447
+ /**
448
+ * @internal Wire `Browser.setDownloadBehavior` (`eventsEnabled: true`) plus
449
+ * the `downloadWillBegin` / `downloadProgress` listeners on this session.
450
+ * See the module doc's Downloads note for why `Browser.*` (not the
451
+ * deprecated `Page.*` pair) and why it works on an auxiliary session.
452
+ *
453
+ * `Browser.*` download events are browser-context-global, so we also enable
454
+ * the `Page` domain and track this target's frame ids, then only record
455
+ * downloads originating from a frame we own — two instrumented pages in one
456
+ * Chrome must not cross-observe each other's downloads.
457
+ */
458
+ async _enableDownloads(opts) {
459
+ this._downloadsEnabled = true;
460
+ this._downloadDir = opts.dir;
461
+ this._onDownload = opts.onDownload;
462
+ // Seed + track the frame ids owned by this page's target so download-event
463
+ // attribution is page-scoped (Browser.* events are context-global). Page
464
+ // domain on our auxiliary session is independent of Puppeteer's own session.
465
+ await this._cdp.send("Page.enable");
466
+ try {
467
+ const { frameTree } = (await this._cdp.send("Page.getFrameTree"));
468
+ const walk = (node) => {
469
+ this._ownedFrames.add(node.frame.id);
470
+ for (const child of node.childFrames ?? []) {
471
+ walk(child);
472
+ }
473
+ };
474
+ walk(frameTree);
475
+ this._frameTreeSeeded = true;
476
+ }
477
+ catch {
478
+ // best-effort: if the frame tree can't be read, fall back to accepting
479
+ // all download events (single-page runs are unaffected; the cross-page
480
+ // guard just degrades to off rather than erroring).
481
+ }
482
+ const onFrameAttached = (e) => {
483
+ this._ownedFrames.add(e.frameId);
484
+ };
485
+ const onFrameDetached = (e) => {
486
+ this._ownedFrames.delete(e.frameId);
487
+ };
488
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
489
+ this._cdp.on("Page.frameAttached", onFrameAttached);
490
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
491
+ this._cdp.on("Page.frameDetached", onFrameDetached);
492
+ await this._cdp.send("Browser.setDownloadBehavior", {
493
+ behavior: "allow",
494
+ downloadPath: opts.dir,
495
+ eventsEnabled: true,
496
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
497
+ });
498
+ const onWillBegin = (event) => {
499
+ // Only record downloads from a frame this page owns. The filter engages
500
+ // ONLY when the initial frame tree seeded successfully (_frameTreeSeeded)
501
+ // — otherwise we accept all events (fallback), and later frameAttached
502
+ // ids must NOT flip that into a partial filter (codex R2 P2). An event
503
+ // with no frameId is also accepted rather than silently dropped.
504
+ if (this._frameTreeSeeded &&
505
+ event.frameId !== undefined &&
506
+ !this._ownedFrames.has(event.frameId)) {
507
+ return;
508
+ }
509
+ this._pendingDownloads.set(event.guid, {
510
+ url: event.url,
511
+ suggestedFilename: event.suggestedFilename,
512
+ });
513
+ };
514
+ const onProgress = (event) => {
515
+ // Unknown guid = a download we didn't record in onWillBegin (either it
516
+ // began before attach, or it belongs to another page — see the frame
517
+ // filter above). Ignore it.
518
+ const pending = this._pendingDownloads.get(event.guid);
519
+ if (!pending)
520
+ return;
521
+ const entry = {
522
+ guid: event.guid,
523
+ url: pending.url,
524
+ suggestedFilename: pending.suggestedFilename,
525
+ path: `${this._downloadDir}/${pending.suggestedFilename}`,
526
+ };
527
+ if (event.state === "inProgress") {
528
+ this._notifyDownload(entry, "inProgress");
529
+ return;
530
+ }
531
+ this._pendingDownloads.delete(event.guid);
532
+ // Emit evidence for EVERY terminal download (best-effort, isolated from
533
+ // the waiter state machine — a throwing callback must not wedge it).
534
+ this._notifyDownload(entry, event.state);
535
+ // Hand the terminal result to the next waiter (FIFO). A terminal
536
+ // download with no waiter is untargeted — its evidence is already
537
+ // emitted, so we simply drop it (never buffer it to satisfy a LATER,
538
+ // unrelated waitForDownload — that would silently mis-scope the wait).
539
+ const waiter = this._downloadWaiters.shift();
540
+ if (!waiter)
541
+ return;
542
+ if (event.state === "completed") {
543
+ waiter.resolve(entry);
544
+ }
545
+ else {
546
+ waiter.reject(new Error(`waitForDownload: download "${entry.suggestedFilename}" (${entry.guid}) was canceled`));
547
+ }
548
+ };
549
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
550
+ this._cdp.on("Browser.downloadWillBegin", onWillBegin);
551
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
552
+ this._cdp.on("Browser.downloadProgress", onProgress);
553
+ this._cleanups.push(() => {
554
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
555
+ this._cdp.off("Browser.downloadWillBegin", onWillBegin);
556
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
557
+ this._cdp.off("Browser.downloadProgress", onProgress);
558
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
559
+ this._cdp.off("Page.frameAttached", onFrameAttached);
560
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
561
+ this._cdp.off("Page.frameDetached", onFrameDetached);
562
+ // Mark disabled + reject any still-pending waiters so nothing hangs
563
+ // until its own timeout past detach, and a post-detach call fails fast.
564
+ this._downloadsEnabled = false;
565
+ this._frameTreeSeeded = false;
566
+ this._pendingDownloads.clear();
567
+ this._ownedFrames.clear();
568
+ const waiting = this._downloadWaiters.splice(0, this._downloadWaiters.length);
569
+ for (const w of waiting) {
570
+ w.reject(new Error("waitForDownload: evidence session detached while waiting"));
571
+ }
572
+ });
573
+ }
574
+ /** @internal Best-effort onDownload callback — never let it wedge the waiter machine. */
575
+ _notifyDownload(entry, state) {
576
+ try {
577
+ this._onDownload?.(entry, state);
578
+ }
579
+ catch {
580
+ // best-effort — a throwing evidence callback must not break download waits
581
+ }
582
+ }
583
+ /**
584
+ * Wait for the NEXT download (one that completes after this call) to finish,
585
+ * and resolve with its metadata. Register the wait *before* triggering the
586
+ * action that starts the download — `GlubeanPage.waitForDownload(action)` in
587
+ * `page.ts` does exactly this and is the ergonomic wrapper most callers
588
+ * should use instead of this lower-level method.
589
+ *
590
+ * Rejects if the next download is canceled, after `timeoutMs`, if `signal`
591
+ * aborts (e.g. the triggering action threw), or if the session has detached.
592
+ * Does **not** resolve from downloads that already completed before the call —
593
+ * each wait is scoped to a fresh, future download.
594
+ */
595
+ waitForDownload(timeoutMs, signal) {
596
+ if (!this._downloadsEnabled) {
597
+ return Promise.reject(new Error("waitForDownload: downloads are not enabled on this page"));
598
+ }
599
+ if (signal?.aborted) {
600
+ return Promise.reject(new Error("waitForDownload: aborted before it started"));
601
+ }
602
+ return new Promise((resolve, reject) => {
603
+ // Single teardown for EVERY exit path (timeout, abort, resolve, reject)
604
+ // so the timer, the waiter registration, and the abort listener are all
605
+ // always released — no listener leak on the timeout path (codex R2 P3).
606
+ const cleanup = () => {
607
+ clearTimeout(timer);
608
+ signal?.removeEventListener("abort", onAbort);
609
+ const idx = this._downloadWaiters.indexOf(waiter);
610
+ if (idx >= 0)
611
+ this._downloadWaiters.splice(idx, 1);
612
+ };
613
+ const timer = setTimeout(() => {
614
+ cleanup();
615
+ reject(new Error(`waitForDownload: no download completed after ${timeoutMs}ms`));
616
+ }, timeoutMs);
617
+ const onAbort = () => {
618
+ cleanup();
619
+ reject(new Error("waitForDownload: aborted (triggering action failed)"));
620
+ };
621
+ if (signal)
622
+ signal.addEventListener("abort", onAbort, { once: true });
623
+ const waiter = {
624
+ resolve: (entry) => {
625
+ cleanup();
626
+ resolve(entry);
627
+ },
628
+ reject: (err) => {
629
+ cleanup();
630
+ reject(err);
631
+ },
632
+ };
633
+ this._downloadWaiters.push(waiter);
634
+ });
635
+ }
636
+ /**
637
+ * Capture the current page's cookies + localStorage as a {@link StorageState}
638
+ * snapshot — the counterpart to {@link EvidenceSessionOptions.storageState}.
639
+ * Cookies are scoped to the page's current URL (`Network.getCookies`), not
640
+ * every cookie the browser holds, so unrelated tabs/origins never leak in.
641
+ *
642
+ * @example
643
+ * ```ts
644
+ * await page.goto("/login");
645
+ * // ... perform login ...
646
+ * const state = await page.getStorageState();
647
+ * // Reuse on a fresh page to skip the login flow:
648
+ * const chrome2 = browser({ launch: true, storageState: state });
649
+ * ```
650
+ */
651
+ async captureStorageState(page) {
652
+ const { cookies } = (await this._cdp.send("Network.getCookies", {
653
+ urls: [page.url()],
654
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
655
+ }));
656
+ const localStorage = await page.evaluate(() => {
657
+ const out = {};
658
+ try {
659
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
660
+ const ls = globalThis.localStorage;
661
+ for (let i = 0; i < ls.length; i++) {
662
+ const key = ls.key(i);
663
+ if (key !== null)
664
+ out[key] = ls.getItem(key) ?? "";
665
+ }
666
+ }
667
+ catch {
668
+ // localStorage may be inaccessible (e.g. sandboxed/about:blank) — best-effort.
669
+ }
670
+ return out;
671
+ });
672
+ return {
673
+ cookies: (cookies ?? []).map((c) => ({
674
+ name: c.name,
675
+ value: c.value,
676
+ domain: c.domain,
677
+ path: c.path,
678
+ expires: c.expires,
679
+ httpOnly: c.httpOnly,
680
+ secure: c.secure,
681
+ sameSite: c.sameSite,
682
+ })),
683
+ localStorage,
684
+ };
685
+ }
308
686
  _guardViewport(page) {
309
687
  // Guardrail ①: Glubean owns the viewport via Emulation on this session.
310
688
  // Block page.setViewport() so it can't clobber the override last-wins.
@@ -1 +1 @@
1
- {"version":3,"file":"evidence.js","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EACL,mBAAmB,GAGpB,MAAM,cAAc,CAAC;AA+JtB,yEAAyE;AAEzE,qDAAqD;AACrD,MAAM,UAAU,SAAS,CACvB,IAAc,EACd,GAAoC;IAEpC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;QAC1E,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpE,sEAAsE;IACtE,6EAA6E;IAC7E,8EAA8E;IAC9E,6EAA6E;IAC7E,MAAM,SAAS,GAAG,IAAI,MAAM,CAC1B,IAAI,CAAC,GAAG,CAAC,MAAM,EACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CACpC,CAAC;IACF,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,QAAQ,CACtB,KAA0B,EAC1B,GAAoC;IAEpC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;GAMG;AACH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C;YACH,YAAY;SACb,CAAC;IACJ,CAAC;IAEO,cAAc,CAAC,IAAU;QAC/B,wEAAwE;QACxE,uEAAuE;QACvE,MAAM,OAAO,GAAG,eAAe,CAC7B,IAAI,EACJ,aAAa,EACb,qEAAqE;YACnE,mEAAmE;YACnE,yEAAyE,EAC3E,GAAG,EAAE,CAAC,IAAI,CACX,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM;QACV,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,sEAAsE;QACtE,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;YAC/C,IAAI,CAAC;gBACH,MAAM,OAAO,EAAE,CAAC;YAClB,CAAC;YAAC,MAAM,CAAC;gBACP,iDAAiD;YACnD,CAAC;QACH,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAE1B,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,gCAAgC;QAClC,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * GlubeanFrame — locator ergonomics scoped to an `<iframe>`'s content frame.
3
+ *
4
+ * Per the proposal's "iframe is a hybrid" note (browser-testing-cloud-rollout.md
5
+ * M5): CDP already does the execution-context switch — that's Puppeteer's own
6
+ * `Frame` object, wired up via `Page.frameAttached` / `Runtime.executionContextCreated`
7
+ * before this module ever runs. The only thing missing was the encapsulation
8
+ * layer's locator ergonomics (byTestId/byText/byRole/byLabel, auto-tracing
9
+ * click/fill/type/hover, auto-retrying expect*) scoped to a frame instead of
10
+ * the top-level page — that's what this module adds. Created via
11
+ * `GlubeanPage.frame(selector)`.
12
+ *
13
+ * @module frame
14
+ */
15
+ import type { Frame } from "puppeteer-core";
16
+ import { type LocatorContext, type WrappedLocator } from "./locator.js";
17
+ /** Options accepted by GlubeanFrame's interaction methods. */
18
+ export interface FrameActionOptions {
19
+ /** Timeout in ms (overrides the frame's configured default). */
20
+ timeout?: number;
21
+ }
22
+ /**
23
+ * A Puppeteer `Frame` wrapped with the same locator/assertion ergonomics as
24
+ * `GlubeanPage`, scoped to that frame's content. Returned by `page.frame()`.
25
+ */
26
+ export declare class GlubeanFrame {
27
+ /** The underlying Puppeteer Frame for advanced use cases. */
28
+ readonly raw: Frame;
29
+ private readonly _ctx;
30
+ private readonly _actionTimeout;
31
+ /** @internal — created by `GlubeanPage.frame()`. */
32
+ constructor(frame: Frame, ctx: LocatorContext, actionTimeout: number);
33
+ /** Current frame URL. */
34
+ url(): string;
35
+ /**
36
+ * Create a WrappedLocator scoped to this frame — same auto-tracing/
37
+ * screenshot behavior as `GlubeanPage.locator()`.
38
+ */
39
+ locator(selector: string): WrappedLocator;
40
+ /** Locate an element by its `data-testid` attribute, scoped to this frame. */
41
+ byTestId(id: string): WrappedLocator;
42
+ /** Locate an element by its visible text content, scoped to this frame. */
43
+ byText(text: string): WrappedLocator;
44
+ /** Locate an element by its ARIA role (and optionally accessible name), scoped to this frame. */
45
+ byRole(role: string, options?: {
46
+ name?: string;
47
+ }): WrappedLocator;
48
+ /** Locate an element by its accessible name (ARIA label), scoped to this frame. */
49
+ byLabel(label: string): WrappedLocator;
50
+ /** Click an element matching the selector, scoped to this frame. */
51
+ click(selector: string, options?: FrameActionOptions): Promise<void>;
52
+ /** Clear an input and type a new value, scoped to this frame. */
53
+ fill(selector: string, value: string, options?: FrameActionOptions): Promise<void>;
54
+ /** Type text into an element (appends — does not clear), scoped to this frame. */
55
+ type(selector: string, text: string, options?: FrameActionOptions): Promise<void>;
56
+ /** Hover over an element matching the selector, scoped to this frame. */
57
+ hover(selector: string, options?: FrameActionOptions): Promise<void>;
58
+ /** Check whether an element is currently visible. Returns immediately — does not wait. */
59
+ isVisible(selector: string): Promise<boolean>;
60
+ /** Assert that an element is visible, scoped to this frame. Retries until visible or timeout. */
61
+ expectVisible(selector: string, options?: {
62
+ timeout?: number;
63
+ }): Promise<void>;
64
+ /** Assert that an element is hidden or absent, scoped to this frame. Retries until hidden or timeout. */
65
+ expectHidden(selector: string, options?: {
66
+ timeout?: number;
67
+ }): Promise<void>;
68
+ /**
69
+ * Assert that an element's text content matches `expected`, scoped to this
70
+ * frame. Retries until match or timeout. Same normalize/match rules as
71
+ * `GlubeanPage.expectText()`.
72
+ */
73
+ expectText(selector: string, expected: string | RegExp, options?: {
74
+ timeout?: number;
75
+ exact?: boolean;
76
+ ignoreCase?: boolean;
77
+ }): Promise<void>;
78
+ private static readonly _POLL_MS;
79
+ private _retryUntil;
80
+ }
81
+ /** @internal Build a {@link GlubeanFrame} — called by `GlubeanPage.frame()`. */
82
+ export declare function createFrame(frame: Frame, ctx: LocatorContext, actionTimeout: number): GlubeanFrame;
83
+ //# sourceMappingURL=frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../src/frame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAwB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9F,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,qBAAa,YAAY;IACvB,6DAA6D;IAC7D,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;IAEpB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAiB;IACtC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IAExC,oDAAoD;gBACxC,KAAK,EAAE,KAAK,EAAE,GAA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