Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anxuanzi/bua
/ functions
Functions
249 in github.com/anxuanzi/bua
⨍
Functions
249
◇
Types & classes
95
↓ 29 callers
Method
ActivePage
ActivePage returns the currently active page.
browser/browser.go:287
↓ 17 callers
Method
RefreshElementMap
RefreshElementMap updates the cached element map.
agent/adk_tools.go:28
↓ 10 callers
Method
WaitStable
WaitStable waits for the page to become stable.
browser/browser.go:455
↓ 8 callers
Method
Get
Get returns an element by index.
dom/element.go:176
↓ 7 callers
Method
Click
Click clicks on an element by index.
browser/page.go:105
↓ 6 callers
Function
Capture
Capture takes a screenshot of the page and returns compressed bytes. It implements proper page readiness checks following browser-use best practices.
screenshot/screenshot.go:117
↓ 6 callers
Method
Center
Center returns the center point of the bounding box.
dom/element.go:14
↓ 5 callers
Function
DefaultAnnotationConfig
DefaultAnnotationConfig returns sensible defaults for annotations.
screenshot/annotate.go:38
↓ 5 callers
Method
GetElementMap
GetElementMap returns the current element map.
agent/adk_tools.go:38
↓ 5 callers
Method
Len
()
screenshot/screenshot.go:41
↓ 5 callers
Method
Navigate
Navigate opens a URL in the browser. This is a convenience method for direct navigation without a task.
bua.go:139
↓ 5 callers
Method
highlightElement
highlightElement shows a visual highlight on an element.
browser/page.go:482
↓ 5 callers
Function
humanDelay
humanDelay adds a random human-like delay.
browser/stealth.go:255
↓ 4 callers
Method
Close
Close shuts down the browser and cleans up resources.
bua.go:152
↓ 4 callers
Method
GetY
()
screenshot/screenshot.go:22
↓ 4 callers
Function
LLMOptions
LLMOptions returns options optimized for LLM vision consumption. Includes page readiness checks and content validation.
screenshot/screenshot.go:101
↓ 4 callers
Method
ToTokenStringLimited
ToTokenStringLimited is a convenience method with a max elements limit.
dom/serialize.go:69
↓ 4 callers
Function
clamp
clamp restricts a value to be within min and max.
screenshot/annotate.go:275
↓ 3 callers
Function
Annotate
Annotate draws bounding boxes and labels on a screenshot image. Following browser-use pattern: boxes around interactive elements with index labels.
screenshot/annotate.go:55
↓ 3 callers
Function
BuildPageStatePrompt
BuildPageStatePrompt creates a prompt describing the current page state.
agent/prompts.go:134
↓ 3 callers
Function
CaptureWithAnnotations
CaptureWithAnnotations captures a screenshot and draws element annotations. This follows browser-use pattern: bounding boxes around interactive elemen
screenshot/screenshot.go:497
↓ 3 callers
Function
DefaultAnnotatedOptions
DefaultAnnotatedOptions returns options with annotations enabled.
screenshot/screenshot.go:486
↓ 3 callers
Method
Description
Description returns a human-readable description of the element.
dom/element.go:98
↓ 3 callers
Method
GetX
()
screenshot/screenshot.go:21
↓ 3 callers
Function
NewElementMapAdapter
NewElementMapAdapter creates an adapter for annotation.
browser/page.go:665
↓ 3 callers
Function
NewExtractor
NewExtractor creates a new DOM extractor.
dom/extract.go:158
↓ 3 callers
Method
Run
Run executes a task described in natural language. Returns a Result containing the outcome and execution details.
bua.go:94
↓ 3 callers
Method
Screenshot
Screenshot takes a screenshot of the current page. Uses the enhanced screenshot package with proper page readiness checks.
browser/page.go:559
↓ 3 callers
Method
ScreenshotSafe
ScreenshotSafe takes a screenshot, returning nil (not error) for blank pages. This is useful for agent loops where blank screenshots should be skipped
browser/page.go:574
↓ 3 callers
Method
ScreenshotSafeWithAnnotations
ScreenshotSafeWithAnnotations takes an annotated screenshot, returning nil for blank pages.
browser/page.go:717
↓ 3 callers
Method
Start
Start launches the browser and initializes the agent.
bua.go:37
↓ 3 callers
Function
containsIgnoreCase
containsIgnoreCase checks if s contains substr (case-insensitive).
dom/element.go:265
↓ 3 callers
Function
isBlankPage
isBlankPage checks if the page is a blank page (about:blank or empty).
screenshot/screenshot.go:204
↓ 2 callers
Method
Add
Add adds an element to the map.
dom/element.go:167
↓ 2 callers
Method
Contains
Contains checks if a point is within the bounding box.
dom/element.go:19
↓ 2 callers
Method
Extract
Extract extracts interactive elements from the page.
dom/extract.go:166
↓ 2 callers
Method
FilterSensitiveData
FilterSensitiveData filters sensitive data from a message.
agent/message.go:171
↓ 2 callers
Method
GetConsecutiveFailures
GetConsecutiveFailures returns the number of consecutive failures at the end.
agent/history.go:184
↓ 2 callers
Method
GetElementMap
GetElementMap extracts interactive elements from the current page.
browser/browser.go:440
↓ 2 callers
Method
GetElements
()
screenshot/screenshot.go:42
↓ 2 callers
Method
GetWidth
()
screenshot/screenshot.go:23
↓ 2 callers
Function
IsPageReady
IsPageReady checks if the page is ready for screenshot capture.
screenshot/screenshot.go:295
↓ 2 callers
Method
ListTabs
ListTabs returns information about all open tabs.
bua.go:253
↓ 2 callers
Function
New
New creates a new browser automation agent. Call Start() before using Run().
bua.go:24
↓ 2 callers
Function
New
New creates a new browser instance.
browser/browser.go:91
↓ 2 callers
Method
NewTab
NewTab opens a new browser tab.
bua.go:214
↓ 2 callers
Method
ScreenshotAfterAction
ScreenshotAfterAction captures a screenshot after an action completes. Waits for page stability before capturing.
browser/page.go:585
↓ 2 callers
Method
StepCount
StepCount returns the number of steps executed.
agent/history.go:86
↓ 2 callers
Function
applyStealthMode
applyStealthMode injects stealth JavaScript into a page.
browser/stealth.go:195
↓ 2 callers
Method
captureAndSaveScreenshot
captureAndSaveScreenshot captures a screenshot and saves it to disk if configured. Returns the screenshot bytes and the saved path (empty if not saved
agent/agent.go:480
↓ 2 callers
Method
clearInput
clearInput clears the currently focused input.
browser/page.go:330
↓ 2 callers
Method
createMultimodalContent
createMultimodalContent creates a genai.Content with both text and image.
agent/agent.go:603
↓ 2 callers
Function
generateTabID
generateTabID creates a unique 4-character tab ID.
browser/browser.go:465
↓ 2 callers
Function
isEmptyImage
isEmptyImage checks if the image is mostly white/empty. Uses sampling to check a grid of pixels for efficiency.
screenshot/screenshot.go:246
↓ 2 callers
Function
randomMouseOffset
randomMouseOffset returns a small random offset for more human-like clicking.
browser/stealth.go:272
↓ 2 callers
Function
toLower
toLower converts ASCII characters to lowercase.
dom/element.go:282
↓ 1 callers
Method
AddHistoryItem
AddHistoryItem adds an item to the execution history.
agent/message.go:59
↓ 1 callers
Method
AddItem
AddItem adds a new history item.
agent/history.go:49
↓ 1 callers
Method
BuildContinuationMessage
BuildContinuationMessage builds a message for continuing after an action.
agent/message.go:132
↓ 1 callers
Function
BuildErrorRecoveryPrompt
BuildErrorRecoveryPrompt creates a prompt for recovering from an error.
agent/prompts.go:177
↓ 1 callers
Method
BuildInitialTaskMessage
BuildInitialTaskMessage builds the initial message with task description.
agent/message.go:110
↓ 1 callers
Method
BuildStateMessage
BuildStateMessage builds the current state message for the LLM.
agent/message.go:69
↓ 1 callers
Function
BuildTaskPrompt
BuildTaskPrompt creates the initial task prompt.
agent/prompts.go:154
↓ 1 callers
Method
Clear
Clear resets the history.
agent/history.go:91
↓ 1 callers
Method
ClearAndType
ClearAndType clears an input and types new text.
browser/page.go:285
↓ 1 callers
Method
Close
Close shuts down the browser and cleans up resources.
browser/browser.go:250
↓ 1 callers
Method
CloseTab
CloseTab closes a tab by ID.
bua.go:240
↓ 1 callers
Method
CreateAllTools
CreateAllTools creates all browser automation tools.
agent/adk_tools.go:777
↓ 1 callers
Method
CreateClearAndTypeTool
CreateClearAndTypeTool creates the clear_and_type function tool.
agent/adk_tools.go:393
↓ 1 callers
Method
CreateClickTool
CreateClickTool creates the click function tool.
agent/adk_tools.go:354
↓ 1 callers
Method
CreateCloseTabTool
CreateCloseTabTool creates the close_tab function tool.
agent/adk_tools.go:694
↓ 1 callers
Method
CreateDoneTool
CreateDoneTool creates the done function tool.
agent/adk_tools.go:760
↓ 1 callers
Method
CreateDoubleClickTool
CreateDoubleClickTool creates the double_click function tool.
agent/adk_tools.go:504
↓ 1 callers
Method
CreateEvaluateJSTool
CreateEvaluateJSTool creates the evaluate_js function tool.
agent/adk_tools.go:619
↓ 1 callers
Method
CreateExtractContentTool
CreateExtractContentTool creates the extract_content function tool.
agent/adk_tools.go:580
↓ 1 callers
Method
CreateFocusTool
CreateFocusTool creates the focus function tool.
agent/adk_tools.go:524
↓ 1 callers
Method
CreateGetPageStateTool
CreateGetPageStateTool creates the get_page_state function tool.
agent/adk_tools.go:734
↓ 1 callers
Method
CreateGoBackTool
CreateGoBackTool creates the go_back function tool.
agent/adk_tools.go:450
↓ 1 callers
Method
CreateGoForwardTool
CreateGoForwardTool creates the go_forward function tool.
agent/adk_tools.go:467
↓ 1 callers
Method
CreateHoverTool
CreateHoverTool creates the hover function tool.
agent/adk_tools.go:484
↓ 1 callers
Method
CreateListTabsTool
CreateListTabsTool creates the list_tabs function tool.
agent/adk_tools.go:711
↓ 1 callers
Method
CreateNavigateTool
---- Tool Functions ---- CreateNavigateTool creates the navigate function tool.
agent/adk_tools.go:337
↓ 1 callers
Method
CreateNewTabTool
CreateNewTabTool creates the new_tab function tool.
agent/adk_tools.go:659
↓ 1 callers
Method
CreateReloadTool
CreateReloadTool creates the reload function tool.
agent/adk_tools.go:543
↓ 1 callers
Method
CreateScreenshotTool
CreateScreenshotTool creates the screenshot function tool.
agent/adk_tools.go:601
↓ 1 callers
Method
CreateScrollToElementTool
CreateScrollToElementTool creates the scroll_to_element function tool.
agent/adk_tools.go:560
↓ 1 callers
Method
CreateScrollTool
CreateScrollTool creates the scroll function tool.
agent/adk_tools.go:412
↓ 1 callers
Method
CreateSendKeysTool
CreateSendKeysTool creates the send_keys function tool.
agent/adk_tools.go:433
↓ 1 callers
Method
CreateSwitchTabTool
CreateSwitchTabTool creates the switch_tab function tool.
agent/adk_tools.go:677
↓ 1 callers
Method
CreateTypeTextTool
CreateTypeTextTool creates the type_text function tool.
agent/adk_tools.go:374
↓ 1 callers
Method
CreateWaitTool
CreateWaitTool creates the wait function tool.
agent/adk_tools.go:636
↓ 1 callers
Function
DefaultSerializeOptions
DefaultSerializeOptions returns sensible defaults.
dom/serialize.go:25
↓ 1 callers
Function
DefaultStealthConfig
DefaultStealthConfig returns sensible stealth defaults.
browser/stealth.go:44
↓ 1 callers
Function
DefaultViewport
DefaultViewport returns the default viewport size.
config.go:35
↓ 1 callers
Method
DoubleClick
DoubleClick double-clicks on an element by index.
browser/page.go:188
↓ 1 callers
Method
EstimateTokens
EstimateTokens estimates the number of tokens in a text string. This uses a simple character-based heuristic: - ~4 characters per token for English te
agent/token.go:26
↓ 1 callers
Method
EvaluateJS
EvaluateJS evaluates JavaScript code on the page.
browser/page.go:639
↓ 1 callers
Method
ExtractContent
ExtractContent extracts text content from the page.
browser/page.go:615
↓ 1 callers
Method
Filter
Filter replaces sensitive data with placeholders.
agent/message.go:200
↓ 1 callers
Method
Focus
Focus focuses on an element.
browser/page.go:534
next →
1–100 of 249, ranked by callers