camel icon indicating copy to clipboard operation
camel copied to clipboard

[BUG] hybrid_browser_tookit viewport mode is not working as supposed

Open YunfeiZHAO opened this issue 1 month ago • 2 comments

Required prerequisites

What version of camel are you using?

0.2.79a2

System information

3.12.11 | packaged by Anaconda, Inc. | (main, Jun 5 2025, 12:58:53) [MSC v.1929 64 bit (AMD64)] win32 0.2.79a2

Problem description

For hybrid_browser_tookit, when we use the snapshot with viewport=True, the snapshot still returns the whole web content. The issue is from the ts websocket getSnapshotForAINative in browser-session.ts

browser_debug.py

Reproducible example code

The Python snippets:


Command lines:


Extra dependencies:


Steps to reproduce:

  1. Put browser_debug.py in camel\toolkits
  2. Add this in launch.json { "name": "browser_debug.py", "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/camel/toolkits/hybrid_browser_toolkit/browser_debug.py", "console": "integratedTerminal", "cwd": "${workspaceFolder}", "envFile": "${workspaceFolder}/.env", "env": { "PYTHONPATH": "${workspaceFolder}" }, "args": [ "--mode", "typescript", "--cache-dir", "debug_output" ], "justMyCode": false, "stopOnEntry": false, "showReturnValue": true },
  3. Run the snapshot command

Traceback

The snapshot is always the whole page elements

Expected behavior

We should get only the element in the viewport

Additional context

No response

YunfeiZHAO avatar Nov 13 '25 15:11 YunfeiZHAO

@YunfeiZHAO thanks for reporting this issue! could @nitpicker55555 take a look at this issue?

fengju0213 avatar Nov 14 '25 03:11 fengju0213

@YunfeiZHAO thanks for reporting this issue! could @nitpicker55555 take a look at this issue?

Yunfei is working on this issue

nitpicker55555 avatar Nov 14 '25 09:11 nitpicker55555