[BUG] hybrid_browser_tookit viewport mode is not working as supposed
Required prerequisites
- [x] I have read the documentation https://camel-ai.github.io/camel/camel.html.
- [x] I have searched the Issue Tracker and Discussions that this hasn't already been reported. (+1 or comment there if it has.)
- [ ] Consider asking first in a Discussion.
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
Reproducible example code
The Python snippets:
Command lines:
Extra dependencies:
Steps to reproduce:
- Put browser_debug.py in camel\toolkits
- 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 },
- 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 thanks for reporting this issue! could @nitpicker55555 take a look at this issue?
@YunfeiZHAO thanks for reporting this issue! could @nitpicker55555 take a look at this issue?
Yunfei is working on this issue