@tlockney/cdp-kernel 0.9.0 → 0.11.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.
@@ -28,6 +28,13 @@ export interface BrowserTargetOptions {
28
28
  * called with `{ host, jupyter }` (#384).
29
29
  */
30
30
  preload?: string[];
31
+ /**
32
+ * The run's parameters, which cells read as `jupyter.params` (#456). The
33
+ * other targets read them from `GANYMEDE_PARAMS`.
34
+ */
35
+ params?: {
36
+ [name: string]: unknown;
37
+ };
31
38
  /** Answers the Worker's `host.request` calls; without it they reject (#384). */
32
39
  host?: HostHandler;
33
40
  }
@@ -48,7 +48,8 @@ export class BrowserTarget {
48
48
  const target = new BrowserTarget(options.createWorker(), events, options.host);
49
49
  const base = options.base ?? globalThis.location?.href ?? "file:///";
50
50
  try {
51
- const { userAgent } = await target.#request("info", { base, cdn: options.cdn, preload: options.preload ?? [] });
51
+ const params = options.params === undefined ? undefined : JSON.stringify(options.params);
52
+ const { userAgent } = await target.#request("info", { base, cdn: options.cdn, preload: options.preload ?? [], params });
52
53
  if (typeof userAgent === "string")
53
54
  target.versions.runtime = browserName(userAgent);
54
55
  target.versions.engine = engineName(typeof userAgent === "string" ? userAgent : "");