-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Implement demo mode for in-browser logging #3554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 9 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="browser_use/browser/demo_mode.py">
<violation number="1" location="browser_use/browser/demo_mode.py:690">
Rendering the log message with innerHTML means any markup in the payload will run in the page context. Please use a safe text assignment or sanitize the payload before inserting it.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
…security by preventing HTML injection.
3c4586b to
1c85a8a
Compare
|
super cool! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
|
Happy to merge this |
|
is there a way to make it consistent across navigation? |
|
maybe you could even find a way how we could make this so nice that people want to have this as default |
|
maybe similar to the gif version |
|
or e.g. we just show the action as a small overlay in the lower right corner |
|
yes, i will try to work on it |
Summary by cubic
Adds a demo mode that injects a side panel into the browser to stream live agent logs and state. This lets you follow actions, thoughts, errors, and results without checking the console.
New Features
Migration
Written for commit c29e358. Summary will update automatically on new commits.
Note
Adds an optional demo mode that injects a browser side panel to stream live agent/code-agent logs, with session-scoped DOM exclusion and logging hooks across the stack.
DemoModehelper and injected JS panel streaming logs viawindowevents; persisted per-page, toggleable floating button.BrowserProfile.demo_modeflag (default false);BrowserSession.demo_modelazy helper;send_demo_mode_log()API; auto-injected on start; warns if headless.AgentandCodeAgentacceptdemo_mode; broadcast step start/completion, actions (and params), LLM responses/thinking/evaluations, memory/next goal, errors, and final/partial results to the panel.session_idtoDOMTreeSerializer; filter elements marked with session-specificdata-browser-use-exclude-<session_id>(fallback to legacy attr); propagation throughDomService,Page.get_element_by_prompt.examples/demo_mode_example.pyshowcasingAgent(..., demo_mode=True).Written by Cursor Bugbot for commit c29e358. This will update automatically on new commits. Configure here.