MCPcopy
hub / github.com/browser-use/browser-use / wrapped_act

Function wrapped_act

tests/scripts/debug_iframe_scrolling.py:203–217  ·  view source on GitHub ↗
(action, session)

Source from the content-addressed store, hash-verified

201 original_act = tools.act
202
203 async def wrapped_act(action, session):
204 result = await original_act(action, session)
205 # Capture state after each action
206 action_type = 'unknown'
207 if hasattr(action, 'input_text') and action.input_text:
208 action_type = 'input_text'
209 await asyncio.sleep(1) # Give time for DOM to update
210 state = await capture_dom_state('AFTER INPUT_TEXT')
211 states.append(state)
212 elif hasattr(action, 'scroll') and action.scroll:
213 action_type = 'scroll'
214 await asyncio.sleep(2) # Give more time after scroll
215 state = await capture_dom_state('AFTER SCROLL')
216 states.append(state)
217 return result
218
219 tools.act = wrapped_act
220

Callers

nothing calls this directly

Calls 2

capture_dom_stateFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…