capiumbrowser 1.2.1 → 1.2.2

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/lib/channels.json CHANGED
@@ -1,33 +1,37 @@
1
1
  {
2
- "_comment": "SINGLE SOURCE OF TRUTH for the current stable Capium browser build per OS/arch. Each OS reaches stable independently -- edit one entry without touching the others. This file ships inside the wheel (the SDK reads it to pick each host's stable build) AND is published to the download server by the release pipeline. `version` is the Chromium version (what the browser reports to the customer -- unchanged by the revision); `revision` is our packaging counter -- the served R2 folder is chromium-v<version>.<revision>/, ALWAYS dotted-suffixed starting at 1 (chromium-v<version>.1/ is the first build, .2/ a same-engine re-spin), so publishing a re-spin never overwrites the artifact older SDKs still fetch. `published: false` means the tag is declared but no artifact exists yet -- the SDK raises a clear 'not published yet' error instead of a raw 404.",
2
+ "_comment": "SINGLE SOURCE OF TRUTH for the current stable Capium browser build per OS/arch. Each OS reaches stable independently -- edit one entry without touching the others. This file ships inside the wheel (the SDK reads it to pick each host's stable build) AND is published to the download server by the release pipeline. `version` is the reported Chromium version (what the browser reports to the customer, names the R2 folder); `engine_version` is the actual built Chromium engine (box_package verifies the binary against it) -- it differs from `version` when a platform reports a spoofed patch (Windows reports .85 on the .84 engine). `revision` is our packaging counter -- the served R2 folder is chromium-v<version>.<revision>/, ALWAYS dotted-suffixed starting at 1. A Chromium version bump resets revision to 1. `published: false` means the tag is declared but no artifact exists yet.",
3
3
  "schema": 1,
4
- "updated": "2026-10-10",
4
+ "updated": "2026-10-21",
5
5
  "channels": {
6
6
  "stable": {
7
7
  "windows-x64": {
8
- "version": "155.0.8059.39",
9
- "revision": 2,
10
- "sha256": "25ef98b8713c2c9fb62615b4c9aa0d7a3bd20c76320ec3d99e848775b1d4fdd6",
8
+ "version": "155.0.8059.85",
9
+ "engine_version": "155.0.8059.84",
10
+ "revision": 1,
11
+ "sha256": "e10c944fc23637adb8d2f9206dbd69c595d51ba9de0cfd8140c9a2b5dc3510fc",
11
12
  "published": true,
12
13
  "license_status_protocol": 1
13
14
  },
14
15
  "macos-arm64": {
15
- "version": "155.0.8059.39",
16
- "revision": 2,
17
- "sha256": "2c39538576a8c5f63b39ac1f09cdb1cc5f7d2b6899ed7625752c6c4c2737a90f",
16
+ "version": "155.0.8059.84",
17
+ "engine_version": "155.0.8059.84",
18
+ "revision": 1,
19
+ "sha256": "273bdd754b06538f633d2830f6fb8e3f02df226f093cb42acd052c0fece74127",
18
20
  "published": true,
19
21
  "license_status_protocol": 1
20
22
  },
21
23
  "linux-x64": {
22
- "version": "155.0.8059.39",
23
- "revision": 2,
24
- "sha256": "87889050d6a1e46a8aabe4800f8fff5e474a07cd23e22a66f79b830f5544487c",
24
+ "version": "155.0.8059.84",
25
+ "engine_version": "155.0.8059.84",
26
+ "revision": 1,
27
+ "sha256": "e01b9b2179d82594e552f17aa0fad620785b4dfbf368c10c0ea146b5ce31c4e4",
25
28
  "published": true,
26
29
  "license_status_protocol": 1
27
30
  },
28
31
  "linux-arm64": {
29
- "version": "155.0.8059.39",
30
- "revision": 2,
32
+ "version": "155.0.8059.84",
33
+ "engine_version": "155.0.8059.84",
34
+ "revision": 1,
31
35
  "sha256": null,
32
36
  "published": false
33
37
  }
package/lib/config.js CHANGED
@@ -24,12 +24,14 @@ const path = require('path');
24
24
  // the deployed environment for either backend.
25
25
  const IGNORE_DEFAULT_ARGS = ['--enable-automation', '--enable-unsafe-swiftshader'];
26
26
 
27
- // The 155 engine selects a seeded screen within these default bounds. Start
28
- // headless windows small enough to fit its modes without replacing the screen.
29
- // Explicit screen/window flags take
30
- // precedence. HEADLESS_SCREEN remains the upper bound for existing consumers.
27
+ // The 155 engine selects a seeded screen within these default bounds. The headless
28
+ // window is sized PER SEED after launch (fitWindow -> the seed's screen.availWidth/Height),
29
+ // giving a coherent maximized viewport < screen for every profile. HEADLESS_VIEWPORT is only
30
+ // the brief STARTUP fallback before that fit runs; it must fit the smallest default seeded
31
+ // screen (win/linux min is 1280x720), so it is NOT the 800x600 headless-Chrome default tell.
32
+ // Explicit screen/window flags take precedence.
31
33
  const HEADLESS_SCREEN = [1920, 1080];
32
- const HEADLESS_VIEWPORT = [800, 600];
34
+ const HEADLESS_VIEWPORT = [1280, 720];
33
35
 
34
36
  function getHeadlessDefaultArgs() {
35
37
  const [vw, vh] = HEADLESS_VIEWPORT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capiumbrowser",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Drop-in stealth browser SDK on top of Playwright or Puppeteer (Capium Chromium).",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Capzy (https://capzy.ai)",
package/playwright.js CHANGED
@@ -272,6 +272,13 @@ async function launchPersistentContext(userDataDir, opts = {}) {
272
272
  }
273
273
  try { await require('./lib/desktop').requireEngine(ctx, prep.browserBrand); }
274
274
  catch (e) { await ctx.close(); throw e; }
275
+ // Desktop personas: size the window to the seed's screen -- in HEADLESS too, so the
276
+ // viewport is a coherent per-seed maximized size instead of the tiny startup window.
277
+ // Mobile keeps its device viewport.
278
+ if (prep.mobileSeed === null) {
279
+ const page = ctx.pages()[0] || await ctx.newPage();
280
+ await fitWindow(ctx.browser(), ctx, page);
281
+ }
275
282
  return ctx;
276
283
  }
277
284
 
@@ -282,6 +289,7 @@ async function launchPersistentContext(userDataDir, opts = {}) {
282
289
  * window to <= the available screen with a slight offset. No-op on failure/headless.
283
290
  */
284
291
  async function fitWindow(browser, context, page) {
292
+ let pcdp, bcdp;
285
293
  try {
286
294
  const scr = await page.evaluate(() => ({ w: screen.availWidth, h: screen.availHeight }));
287
295
  if (!scr || !scr.w || !scr.h) return;
@@ -293,16 +301,21 @@ async function fitWindow(browser, context, page) {
293
301
  const h = ah;
294
302
  const left = 0;
295
303
  const top = 0;
296
- const pcdp = await context.newCDPSession(page);
304
+ pcdp = await context.newCDPSession(page);
297
305
  const { targetInfo } = await pcdp.send('Target.getTargetInfo');
298
- const bcdp = await browser.newBrowserCDPSession();
306
+ // Persistent contexts may have no Browser handle; their page session still
307
+ // supports the Browser window commands.
308
+ bcdp = browser ? await browser.newBrowserCDPSession() : pcdp;
299
309
  const { windowId } = await bcdp.send('Browser.getWindowForTarget',
300
310
  { targetId: targetInfo.targetId });
301
311
  await bcdp.send('Browser.setWindowBounds', {
302
312
  windowId,
303
313
  bounds: { left, top, width: w, height: h, windowState: 'normal' },
304
314
  });
305
- } catch {}
315
+ } catch {} finally {
316
+ if (bcdp && bcdp !== pcdp) await bcdp.detach().catch(() => {});
317
+ if (pcdp) await pcdp.detach().catch(() => {});
318
+ }
306
319
  }
307
320
 
308
321
  /**
@@ -322,7 +335,7 @@ async function launchContext(opts = {}) {
322
335
  const context = browser.contexts()[0] || (await browser.newContext(browser._capiumMobile ? {} : { viewport: null }));
323
336
  if (humanize) human.humanize(context, humanPreset);
324
337
  const page = context.pages()[0] || (await context.newPage());
325
- if (!headless && !browser._capiumMobile) await fitWindow(browser, context, page); // modest window <= spoofed screen
338
+ if (!browser._capiumMobile) await fitWindow(browser, context, page); // per-seed screen fit (headed + headless)
326
339
  if (url) await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
327
340
  return { browser, context, page };
328
341
  }
package/puppeteer.js CHANGED
@@ -246,11 +246,19 @@ async function launch(opts = {}) {
246
246
  * Returns the Browser.
247
247
  */
248
248
  async function launchPersistentContext(userDataDir, opts = {}) {
249
- return launch({ ...opts, userDataDir });
249
+ const browser = await launch({ ...opts, userDataDir });
250
+ // Desktop personas: fit the window to the seed's screen in HEADLESS too (coherent per-seed
251
+ // viewport, not the tiny startup window). Mobile keeps its device viewport.
252
+ if (!browser._capiumMobile) {
253
+ const page = (await browser.pages())[0] || await browser.newPage();
254
+ await fitWindow(browser, page);
255
+ }
256
+ return browser;
250
257
  }
251
258
 
252
259
  /** Size a modest windowed browser that fits within the seed's spoofed screen. */
253
260
  async function fitWindow(browser, page) {
261
+ let cdp;
254
262
  try {
255
263
  const scr = await page.evaluate(() => ({ w: screen.availWidth, h: screen.availHeight }));
256
264
  if (!scr || !scr.w || !scr.h) return;
@@ -262,7 +270,7 @@ async function fitWindow(browser, page) {
262
270
  const h = ah;
263
271
  const left = 0;
264
272
  const top = 0;
265
- const cdp = await page.createCDPSession();
273
+ cdp = await page.createCDPSession();
266
274
  const { targetInfo } = await cdp.send('Target.getTargetInfo');
267
275
  const { windowId } = await cdp.send('Browser.getWindowForTarget',
268
276
  { targetId: targetInfo.targetId });
@@ -270,8 +278,9 @@ async function fitWindow(browser, page) {
270
278
  windowId,
271
279
  bounds: { left, top, width: w, height: h, windowState: 'normal' },
272
280
  });
273
- await cdp.detach();
274
- } catch {}
281
+ } catch {} finally {
282
+ if (cdp) await cdp.detach().catch(() => {});
283
+ }
275
284
  }
276
285
 
277
286
  /**
@@ -287,7 +296,7 @@ async function launchContext(opts = {}) {
287
296
  const pages = await browser.pages();
288
297
  const page = pages[0] || (await browser.newPage());
289
298
  if (humanize) human.humanize(page, humanPreset);
290
- if (!headless && !browser._capiumMobile) await fitWindow(browser, page);
299
+ if (!browser._capiumMobile) await fitWindow(browser, page); // per-seed screen fit (headed + headless)
291
300
  if (url) await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
292
301
  return { browser, page };
293
302
  }