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 +17 -13
- package/lib/config.js +7 -5
- package/package.json +1 -1
- package/playwright.js +17 -4
- package/puppeteer.js +14 -5
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 --
|
|
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-
|
|
4
|
+
"updated": "2026-10-21",
|
|
5
5
|
"channels": {
|
|
6
6
|
"stable": {
|
|
7
7
|
"windows-x64": {
|
|
8
|
-
"version": "155.0.8059.
|
|
9
|
-
"
|
|
10
|
-
"
|
|
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.
|
|
16
|
-
"
|
|
17
|
-
"
|
|
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.
|
|
23
|
-
"
|
|
24
|
-
"
|
|
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.
|
|
30
|
-
"
|
|
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.
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
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 = [
|
|
34
|
+
const HEADLESS_VIEWPORT = [1280, 720];
|
|
33
35
|
|
|
34
36
|
function getHeadlessDefaultArgs() {
|
|
35
37
|
const [vw, vh] = HEADLESS_VIEWPORT;
|
package/package.json
CHANGED
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
|
-
|
|
304
|
+
pcdp = await context.newCDPSession(page);
|
|
297
305
|
const { targetInfo } = await pcdp.send('Target.getTargetInfo');
|
|
298
|
-
|
|
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 (!
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
274
|
-
|
|
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 (!
|
|
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
|
}
|