@poncho-ai/browser 0.6.22 → 0.6.24

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/browser@0.6.22 build /home/runner/work/poncho-ai/poncho-ai/packages/browser
2
+ > @poncho-ai/browser@0.6.24 build /home/runner/work/poncho-ai/poncho-ai/packages/browser
3
3
  > tsup src/index.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -7,8 +7,8 @@
7
7
  CLI tsup v8.5.1
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
- ESM dist/index.js 46.62 KB
11
- ESM ⚡️ Build success in 52ms
10
+ ESM dist/index.js 47.13 KB
11
+ ESM ⚡️ Build success in 67ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 5085ms
13
+ DTS ⚡️ Build success in 5077ms
14
14
  DTS dist/index.d.ts 13.69 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @poncho-ai/browser
2
2
 
3
+ ## 0.6.24
4
+
5
+ ### Patch Changes
6
+
7
+ - [`51859a9`](https://github.com/cesr/poncho-ai/commit/51859a94041ade5ec9a9892165099d610c3bc363) Thanks [@cesr](https://github.com/cesr)! - Dispatch wheel/scroll events with no pressed button. `injectScroll` went through
8
+ `injectMouse`, which defaults the button to `"left"`, so a `mouseWheel` was sent
9
+ _with the left button_ — Chrome treated scrolling as a left-button drag and could
10
+ leave the button stuck "down", after which clicks stopped registering. Send
11
+ `button: "none"` for wheel events.
12
+
13
+ ## 0.6.23
14
+
15
+ ### Patch Changes
16
+
17
+ - [`2d518d1`](https://github.com/cesr/poncho-ai/commit/2d518d1666e69d63a94be8a781d11d0569e6af7b) Thanks [@cesr](https://github.com/cesr)! - Force the configured viewport on remote browsers (cloud provider / cdpUrl).
18
+ `launchOpts.viewport` is only honored when launching a local context, so a
19
+ Browserbase/Kernel/CDP session rendered at the provider's large default — the
20
+ page looked huge, content tiny, scrolling appeared broken, and tap coordinates
21
+ mismatched the frame after reconnect. After connecting, call
22
+ `setViewport(width, height)` so the page renders at the intended size and frames
23
+ - input stay consistent.
24
+
3
25
  ## 0.6.22
4
26
 
5
27
  ### Patch Changes
package/dist/index.js CHANGED
@@ -427,6 +427,13 @@ var BrowserSession = class {
427
427
  launchOpts.args = baseArgs;
428
428
  }
429
429
  await mgr.launch(launchOpts);
430
+ if (this.isRemote) {
431
+ try {
432
+ await mgr.setViewport(viewport.width ?? 1280, viewport.height ?? 720);
433
+ } catch (e) {
434
+ console.warn(`[poncho][browser] setViewport failed: ${e?.message ?? e}`);
435
+ }
436
+ }
430
437
  this._contextStealthInstalled = false;
431
438
  this._uaOverrideApplied.clear();
432
439
  if (this.stealthEnabled) {
@@ -929,7 +936,12 @@ var BrowserSession = class {
929
936
  x: event.x ?? 0,
930
937
  y: event.y ?? 0,
931
938
  deltaX: event.deltaX,
932
- deltaY: event.deltaY
939
+ deltaY: event.deltaY,
940
+ // A wheel event must NOT carry a pressed button — injectMouse otherwise
941
+ // defaults to "left", which makes Chrome treat the scroll as a
942
+ // left-button drag and can leave the button stuck "down", so subsequent
943
+ // clicks stop registering.
944
+ button: "none"
933
945
  });
934
946
  }
935
947
  // -----------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/browser",
3
- "version": "0.6.22",
3
+ "version": "0.6.24",
4
4
  "description": "Browser automation for Poncho agents, powered by agent-browser",
5
5
  "repository": {
6
6
  "type": "git",
package/src/session.ts CHANGED
@@ -365,6 +365,18 @@ export class BrowserSession {
365
365
 
366
366
  await mgr.launch(launchOpts as Parameters<BrowserManagerInstance["launch"]>[0]);
367
367
 
368
+ // Remote browsers (cloud provider / cdpUrl) ignore launchOpts.viewport —
369
+ // that's only applied when launching a local context — so the page renders
370
+ // at the provider's (often huge) default and the screencast shows it shrunk.
371
+ // Force our configured viewport on the connected page.
372
+ if (this.isRemote) {
373
+ try {
374
+ await mgr.setViewport(viewport.width ?? 1280, viewport.height ?? 720);
375
+ } catch (e) {
376
+ console.warn(`[poncho][browser] setViewport failed: ${(e as Error)?.message ?? e}`);
377
+ }
378
+ }
379
+
368
380
  // Reset stealth tracking for fresh browser
369
381
  this._contextStealthInstalled = false;
370
382
  this._uaOverrideApplied.clear();
@@ -891,6 +903,11 @@ export class BrowserSession {
891
903
  y: event.y ?? 0,
892
904
  deltaX: event.deltaX,
893
905
  deltaY: event.deltaY,
906
+ // A wheel event must NOT carry a pressed button — injectMouse otherwise
907
+ // defaults to "left", which makes Chrome treat the scroll as a
908
+ // left-button drag and can leave the button stuck "down", so subsequent
909
+ // clicks stop registering.
910
+ button: "none",
894
911
  });
895
912
  }
896
913