omowright 0.3.1 → 0.3.3

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/README.md CHANGED
@@ -121,8 +121,7 @@ const run = collectWhileScrolling(page, snoop, {
121
121
  maxScrolls: 15, // or after this many scroll rounds
122
122
  extract: (json) => json.items, // pull items out of each JSON body
123
123
  scroll: "wheel", // "end" jumps to the bottom instead
124
- settleMs: 800, // wait for the next page to land
125
- });
124
+ }); // a round ends when the next response lands; settleMs (default 800) only bounds a silent round
126
125
  let step;
127
126
  while (!(step = await run.next()).done) items.push(step.value);
128
127
  step.value; // { rounds, total, stoppedBecause: "minItems" | "maxScrolls" | "noGrowth" }
package/TOOLS.md CHANGED
@@ -286,7 +286,8 @@ loop; the module files next to it are implementation detail.
286
286
  encodedDataLength, body, base64Encoded, bodySkipped, failed, errorText,
287
287
  startedAt, finishedAt`.
288
288
  - `collectWhileScrolling(page, snoop, { minItems, maxScrolls=10, extract, scroll:
289
- "wheel"|"end", settleMs=800 })`: async generator. Each round scrolls, settles, drains
289
+ "wheel"|"end", settleMs=800 })`: async generator. Each round scrolls, waits for the next
290
+ response or page growth (at most `settleMs`), drains
290
291
  `snoop.popJson()` through `extract(json) => items[]`, yield each item. Returns
291
292
  `{ rounds, total, stoppedBecause: "minItems"|"maxScrolls"|"noGrowth" }`.
292
293
  - `createTrace(page, { dir, screenshots=true, network=true, console=true,
@@ -355,7 +356,9 @@ loop; the module files next to it are implementation detail.
355
356
  `BskRpcError` `no_browser_connected` when no extension is attached, and
356
357
  `extension_outdated` when the chosen extension is 0.4.0 (its task tab groups
357
358
  stay in the user's browser after the task); with no `browser` named it picks
358
- an up-to-date connected browser over a 0.4.0 one. Never launches a browser of
359
+ an up-to-date connected browser over a 0.4.0 one. An extension before 0.4.0
360
+ has no shared control: `cooperate("sync")` resolves without a `context_id`
361
+ there and actions run ungated. Never launches a browser of
359
362
  its own.
360
363
  - `BskSession`: `navigate`, `back`, `forward`, `reload`, `observe`, `snapshot`,
361
364
  `getHtml`, `screenshot({ ref, fullPage })`, `click`, `hover`, `fill`,
@@ -1,3 +1,5 @@
1
+ export declare const BSK_CLI_VERSION = "0.5.0";
2
+ export declare const BSK_PINNED_MANIFEST_URL = "https://github.com/Tencent/BrowserSkill/releases/download/cli-v0.5.0/version.json";
1
3
  export type InstallEnv = Record<string, string | undefined>;
2
4
  export interface InstallCommand {
3
5
  command: string;
package/dist/emulate.d.ts CHANGED
@@ -53,6 +53,7 @@ export declare const DEVICE_PRESETS: Readonly<{
53
53
  platform: undefined;
54
54
  };
55
55
  }>;
56
+ export declare function emulatedDevice(page: object): DevicePreset | undefined;
56
57
  /**
57
58
  * Emulate a device on the given page.
58
59
  * @param {object} page - The page object with cdp.send(), resolveSessionId(), evaluate(), refreshViewportSize()