@@ -39,8 +39,7 @@ OpenBrowser/
3939| Highlight tool | ` server/agent/tools/highlight_tool.py ` | HighlightTool for element discovery |
4040| Element interaction | ` server/agent/tools/element_interaction_tool.py ` | ElementInteractionTool with 2PC flow |
4141| Dialog tool | ` server/agent/tools/dialog_tool.py ` | DialogTool for dialog handling |
42- | JavaScript tool | ` server/agent/tools/javascript_tool.py ` | JavaScriptTool for fallback execution |
43- | ToolSet aggregator | ` server/agent/tools/toolset.py ` | OpenBrowserToolSet aggregates all 5 tools |
42+ | ToolSet aggregator | ` server/agent/tools/toolset.py ` | OpenBrowserToolSet aggregates all 4 tools |
4443| Extension entry | ` extension/src/background/index.ts ` | Command handler, dialog processing |
4544| Dialog manager | ` extension/src/commands/dialog.ts ` | CDP dialog events, cascading |
4645| JavaScript execution | ` extension/src/commands/javascript.ts ` | CDP Runtime.evaluate, dialog race |
@@ -154,26 +153,15 @@ OpenBrowser uses Jinja2 templates for agent prompts, enabling dynamic content in
154153### Template Structure
155154- ** Location** : ` server/agent/prompts/ ` directory
156155- ** Format** : ` .j2 ` extension with Jinja2 syntax
157- - ** 5 Tool Templates** : Each of the 5 focused tools has its own template:
156+ - ** 4 Tool Templates** : Each of the 4 focused tools has its own template:
158157 - ` tab_tool.j2 ` - Tab management documentation
159158 - ` highlight_tool.j2 ` - Element discovery with color coding
160159 - ` element_interaction_tool.j2 ` - 2PC flow with orange confirmations
161160 - ` dialog_tool.j2 ` - Dialog handling
162- - ` javascript_tool.j2 ` - JavaScript fallback
163-
164- ### Dynamic JavaScript Control
165- The ` javascript_execute ` command can be disabled via environment variable:
166- ``` bash
167- export OPEN_BROWSER_DISABLE_JAVASCRIPT_EXECUTE=1
168- ```
169- When disabled:
170- - Template removes all ` javascript_execute ` references using ` {% if not disable_javascript %} ` conditionals
171- - ` OpenBrowserAction.type ` description excludes ` 'javascript_execute' `
172- - Command execution returns error if attempted
173161
174162### Template Features
175163- ** Conditional rendering** : Use ` {% if %} ` blocks for configurable sections
176- - ** Variable injection** : Pass context variables like ` disable_javascript ` at render time
164+ - ** Variable injection** : Pass context variables like model profile flags at render time
177165- ** Clean output** : ` trim_blocks=True ` and ` lstrip_blocks=True ` remove extra whitespace
178166- ** Caching** : Templates are cached after first load for performance
179167
@@ -246,34 +234,18 @@ Elements are identified by a 6-character hash string:
246234| ` scroll_element ` | Scroll by element ID | ` {element_id: "m5k2p8", direction: "down"} ` |
247235| ` keyboard_input ` | Type into element | ` {element_id: "j4n7q1", text: "hello"} ` |
248236
249- ### Tool Mapping (5 -Tool Architecture)
250- The visual interaction workflow is implemented across 5 focused tools:
237+ ### Tool Mapping (4 -Tool Architecture)
238+ The visual interaction workflow is implemented across 4 focused tools:
251239
252240| Tool | Commands | Purpose |
253241| ------| ----------| ---------|
254242| ` tab ` | ` tab init ` , ` tab open ` , ` tab close ` , ` tab switch ` , ` tab list ` , ` tab refresh ` , ` tab view ` , ` tab back ` , ` tab forward ` | Session and tab management |
255243| ` highlight ` | ` highlight_elements ` | Element discovery with blue overlays |
256244| ` element_interaction ` | ` click_element ` , ` confirm_click_element ` , ` hover_element ` , ` scroll_element ` , ` keyboard_input ` , ` confirm_keyboard_input ` , ` select_element ` | Element interaction with 2PC only for click and keyboard input |
257245| ` dialog ` | ` handle_dialog ` | Dialog handling (accept/dismiss) |
258- | ` javascript ` | ` javascript_execute ` | JavaScript fallback execution |
259246
260247## UNIQUE PATTERNS
261248
262- ### JavaScript-First Automation (Fallback)
263- For complex interactions not covered by visual commands:
264- ``` javascript
265- // Click by visible text (universal pattern)
266- (() => {
267- const text = ' YOUR_TEXT' ;
268- const leaf = Array .from (document .querySelectorAll (' *' ))
269- .find (el => el .children .length === 0 && el .textContent .includes (text));
270- if (! leaf) return ' not found' ;
271- const target = leaf .closest (' a, button, [role="button"]' ) || leaf;
272- target .click ();
273- return ' clicked: ' + target .tagName ;
274- })()
275- ```
276-
277249### Multi-Session Tab Isolation
278250- ` tab init <url> ` creates managed session with tab group
279251- ` conversation_id ` ties all commands to session
0 commit comments