Documentation
¶
Index ¶
- Constants
- type DevBrowser
- func (h *DevBrowser) BrowserPositionAndSizeChanged(fieldName string, oldValue, newValue string) error
- func (h *DevBrowser) BrowserStartUrlChanged(fieldName string, oldValue, newValue string) error
- func (b *DevBrowser) CaptureElementScreenshot(selector string) (*ScreenshotResult, error)
- func (b *DevBrowser) CaptureScreenshot(fullpage bool) (*ScreenshotResult, error)
- func (h *DevBrowser) Change(newValue string)
- func (b *DevBrowser) ClearConsoleLogs() error
- func (h *DevBrowser) CloseBrowser() error
- func (h *DevBrowser) CreateBrowserContext() error
- func (b *DevBrowser) GetConsoleLogs() ([]string, error)
- func (b *DevBrowser) GetMCPToolsMetadata() []mcpserve.ToolMetadata
- func (h *DevBrowser) Label() string
- func (b *DevBrowser) LoadConfig()
- func (b *DevBrowser) Logger(messages ...any)
- func (h *DevBrowser) Name() string
- func (h *DevBrowser) OpenBrowser(port string, https bool)
- func (b *DevBrowser) Reload() error
- func (h *DevBrowser) RestartBrowser() error
- func (b *DevBrowser) SaveConfig() error
- func (b *DevBrowser) SetHeadless(headless bool)
- func (b *DevBrowser) SetLog(f func(message ...any))
- func (b *DevBrowser) SetTestMode(testMode bool)
- func (h *DevBrowser) Shortcuts() []map[string]string
- func (h *DevBrowser) StatusMessage() string
- func (h *DevBrowser) Value() string
- type JSError
- type NetworkLogEntry
- type Option
- type ScreenshotResult
Constants ¶
const ( StoreKeyBrowserAutostart = "browser_autostart" StoreKeyBrowserPosition = "browser_position" StoreKeyBrowserSize = "browser_size" StoreKeyViewportMode = "viewport_mode" )
Store keys for browser configuration
const GetPerformanceJS = `` /* 1714-byte string literal not displayed */
GetPerformanceJS extracts page performance metrics optimized for LLM consumption.
const GetStructureJS = `` /* 3048-byte string literal not displayed */
GetStructureJS is the JavaScript used to extract the page structure for LLM understanding.
const InspectElementJS = `` /* 2480-byte string literal not displayed */
InspectElementJS extracts detailed element information like Chrome DevTools. Returns a JSON-like string with box model, position, styles, and accessibility info.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevBrowser ¶
type DevBrowser struct {
// contains filtered or unexported fields
}
func New ¶
func New(ui userInterface, st store, exitChan chan bool, opts ...Option) *DevBrowser
devbrowser.New creates a new DevBrowser instance.
type serverConfig interface {
GetServerPort() string
}
type userInterface interface {
RefreshUI()
ReturnFocus() error
}
example : New(userInterface, st, exitChan, WithCache(true))
func (*DevBrowser) BrowserPositionAndSizeChanged ¶
func (h *DevBrowser) BrowserPositionAndSizeChanged(fieldName string, oldValue, newValue string) error
func (*DevBrowser) BrowserStartUrlChanged ¶
func (h *DevBrowser) BrowserStartUrlChanged(fieldName string, oldValue, newValue string) error
func (*DevBrowser) CaptureElementScreenshot ¶ added in v0.2.33
func (b *DevBrowser) CaptureElementScreenshot(selector string) (*ScreenshotResult, error)
CaptureElementScreenshot captures a screenshot of a specific element.
func (*DevBrowser) CaptureScreenshot ¶ added in v0.2.33
func (b *DevBrowser) CaptureScreenshot(fullpage bool) (*ScreenshotResult, error)
CaptureScreenshot captures a screenshot of the current page.
func (*DevBrowser) Change ¶ added in v0.2.6
func (h *DevBrowser) Change(newValue string)
Change handles user input: toggles auto-start or browser state
func (*DevBrowser) ClearConsoleLogs ¶
func (b *DevBrowser) ClearConsoleLogs() error
ClearConsoleLogs clears the captured console logs.
func (*DevBrowser) CloseBrowser ¶
func (h *DevBrowser) CloseBrowser() error
func (*DevBrowser) CreateBrowserContext ¶
func (h *DevBrowser) CreateBrowserContext() error
func (*DevBrowser) GetConsoleLogs ¶
func (b *DevBrowser) GetConsoleLogs() ([]string, error)
GetConsoleLogs returns captured console logs from the browser. Returns an error if the browser context is not initialized.
func (*DevBrowser) GetMCPToolsMetadata ¶
func (b *DevBrowser) GetMCPToolsMetadata() []mcpserve.ToolMetadata
GetMCPToolsMetadata returns metadata for all DevBrowser MCP tools
func (*DevBrowser) Label ¶
func (h *DevBrowser) Label() string
func (*DevBrowser) LoadConfig ¶ added in v0.2.7
func (b *DevBrowser) LoadConfig()
LoadConfig loads all browser configuration from the store
func (*DevBrowser) Logger ¶ added in v0.2.5
func (b *DevBrowser) Logger(messages ...any)
func (*DevBrowser) Name ¶
func (h *DevBrowser) Name() string
func (*DevBrowser) OpenBrowser ¶
func (h *DevBrowser) OpenBrowser(port string, https bool)
func (*DevBrowser) Reload ¶
func (b *DevBrowser) Reload() error
func (*DevBrowser) RestartBrowser ¶
func (h *DevBrowser) RestartBrowser() error
func (*DevBrowser) SaveConfig ¶ added in v0.2.7
func (b *DevBrowser) SaveConfig() error
SaveConfig saves all browser configuration to the store
func (*DevBrowser) SetHeadless ¶
func (b *DevBrowser) SetHeadless(headless bool)
SetHeadless configura si el navegador debe ejecutarse en modo headless (sin UI). Por defecto es false (muestra la ventana del navegador). Debe llamarse antes de OpenBrowser().
func (*DevBrowser) SetLog ¶ added in v0.2.5
func (b *DevBrowser) SetLog(f func(message ...any))
func (*DevBrowser) SetTestMode ¶ added in v0.2.8
func (b *DevBrowser) SetTestMode(testMode bool)
func (*DevBrowser) Shortcuts ¶ added in v0.2.6
func (h *DevBrowser) Shortcuts() []map[string]string
Shortcuts registers "B" for browser toggle
func (*DevBrowser) StatusMessage ¶ added in v0.2.6
func (h *DevBrowser) StatusMessage() string
StatusMessage returns formatted browser status for logging Format: "Open | Auto-Start: t | Shortcut B" or "Closed | Auto-Start: f | Shortcut B"
func (*DevBrowser) Value ¶ added in v0.2.6
func (h *DevBrowser) Value() string
Value returns current auto-start setting as "t" or "f"
type NetworkLogEntry ¶
Source Files
¶
- CloseBrowser.go
- OpenBrowser.go
- clipboard_utils.go
- config.go
- console_logs.go
- context.go
- devbrowser.go
- geometry_utils.go
- mcp-console.go
- mcp-errors.go
- mcp-evaluate-js.go
- mcp-inspect.go
- mcp-interaction.go
- mcp-management.go
- mcp-navigation.go
- mcp-network.go
- mcp-performance.go
- mcp-screenshot.go
- mcp-structure.go
- mcp-tools.go
- monitor_detection.go
- monitor_geometry.go
- position.go
- screenshot_utils.go
- tui.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cdproto provides the Chrome DevTools Protocol commands, types, and events for the cdproto domain.
|
Package cdproto provides the Chrome DevTools Protocol commands, types, and events for the cdproto domain. |
|
accessibility
Package accessibility provides the Chrome DevTools Protocol commands, types, and events for the Accessibility domain.
|
Package accessibility provides the Chrome DevTools Protocol commands, types, and events for the Accessibility domain. |
|
animation
Package animation provides the Chrome DevTools Protocol commands, types, and events for the Animation domain.
|
Package animation provides the Chrome DevTools Protocol commands, types, and events for the Animation domain. |
|
audits
Package audits provides the Chrome DevTools Protocol commands, types, and events for the Audits domain.
|
Package audits provides the Chrome DevTools Protocol commands, types, and events for the Audits domain. |
|
autofill
Package autofill provides the Chrome DevTools Protocol commands, types, and events for the Autofill domain.
|
Package autofill provides the Chrome DevTools Protocol commands, types, and events for the Autofill domain. |
|
backgroundservice
Package backgroundservice provides the Chrome DevTools Protocol commands, types, and events for the BackgroundService domain.
|
Package backgroundservice provides the Chrome DevTools Protocol commands, types, and events for the BackgroundService domain. |
|
browser
Package browser provides the Chrome DevTools Protocol commands, types, and events for the Browser domain.
|
Package browser provides the Chrome DevTools Protocol commands, types, and events for the Browser domain. |
|
cachestorage
Package cachestorage provides the Chrome DevTools Protocol commands, types, and events for the CacheStorage domain.
|
Package cachestorage provides the Chrome DevTools Protocol commands, types, and events for the CacheStorage domain. |
|
cast
Package cast provides the Chrome DevTools Protocol commands, types, and events for the Cast domain.
|
Package cast provides the Chrome DevTools Protocol commands, types, and events for the Cast domain. |
|
css
Package css provides the Chrome DevTools Protocol commands, types, and events for the CSS domain.
|
Package css provides the Chrome DevTools Protocol commands, types, and events for the CSS domain. |
|
database
Package database provides the Chrome DevTools Protocol commands, types, and events for the Database domain.
|
Package database provides the Chrome DevTools Protocol commands, types, and events for the Database domain. |
|
debugger
Package debugger provides the Chrome DevTools Protocol commands, types, and events for the Debugger domain.
|
Package debugger provides the Chrome DevTools Protocol commands, types, and events for the Debugger domain. |
|
deviceaccess
Package deviceaccess provides the Chrome DevTools Protocol commands, types, and events for the DeviceAccess domain.
|
Package deviceaccess provides the Chrome DevTools Protocol commands, types, and events for the DeviceAccess domain. |
|
deviceorientation
Package deviceorientation provides the Chrome DevTools Protocol commands, types, and events for the DeviceOrientation domain.
|
Package deviceorientation provides the Chrome DevTools Protocol commands, types, and events for the DeviceOrientation domain. |
|
dom
Package dom provides the Chrome DevTools Protocol commands, types, and events for the DOM domain.
|
Package dom provides the Chrome DevTools Protocol commands, types, and events for the DOM domain. |
|
domdebugger
Package domdebugger provides the Chrome DevTools Protocol commands, types, and events for the DOMDebugger domain.
|
Package domdebugger provides the Chrome DevTools Protocol commands, types, and events for the DOMDebugger domain. |
|
domsnapshot
Package domsnapshot provides the Chrome DevTools Protocol commands, types, and events for the DOMSnapshot domain.
|
Package domsnapshot provides the Chrome DevTools Protocol commands, types, and events for the DOMSnapshot domain. |
|
domstorage
Package domstorage provides the Chrome DevTools Protocol commands, types, and events for the DOMStorage domain.
|
Package domstorage provides the Chrome DevTools Protocol commands, types, and events for the DOMStorage domain. |
|
emulation
Package emulation provides the Chrome DevTools Protocol commands, types, and events for the Emulation domain.
|
Package emulation provides the Chrome DevTools Protocol commands, types, and events for the Emulation domain. |
|
eventbreakpoints
Package eventbreakpoints provides the Chrome DevTools Protocol commands, types, and events for the EventBreakpoints domain.
|
Package eventbreakpoints provides the Chrome DevTools Protocol commands, types, and events for the EventBreakpoints domain. |
|
extensions
Package extensions provides the Chrome DevTools Protocol commands, types, and events for the Extensions domain.
|
Package extensions provides the Chrome DevTools Protocol commands, types, and events for the Extensions domain. |
|
fedcm
Package fedcm provides the Chrome DevTools Protocol commands, types, and events for the FedCm domain.
|
Package fedcm provides the Chrome DevTools Protocol commands, types, and events for the FedCm domain. |
|
fetch
Package fetch provides the Chrome DevTools Protocol commands, types, and events for the Fetch domain.
|
Package fetch provides the Chrome DevTools Protocol commands, types, and events for the Fetch domain. |
|
har
Package har provides the Chrome DevTools Protocol commands, types, and events for the HAR domain.
|
Package har provides the Chrome DevTools Protocol commands, types, and events for the HAR domain. |
|
headlessexperimental
Package headlessexperimental provides the Chrome DevTools Protocol commands, types, and events for the HeadlessExperimental domain.
|
Package headlessexperimental provides the Chrome DevTools Protocol commands, types, and events for the HeadlessExperimental domain. |
|
heapprofiler
Package heapprofiler provides the Chrome DevTools Protocol commands, types, and events for the HeapProfiler domain.
|
Package heapprofiler provides the Chrome DevTools Protocol commands, types, and events for the HeapProfiler domain. |
|
indexeddb
Package indexeddb provides the Chrome DevTools Protocol commands, types, and events for the IndexedDB domain.
|
Package indexeddb provides the Chrome DevTools Protocol commands, types, and events for the IndexedDB domain. |
|
input
Package input provides the Chrome DevTools Protocol commands, types, and events for the Input domain.
|
Package input provides the Chrome DevTools Protocol commands, types, and events for the Input domain. |
|
inspector
Package inspector provides the Chrome DevTools Protocol commands, types, and events for the Inspector domain.
|
Package inspector provides the Chrome DevTools Protocol commands, types, and events for the Inspector domain. |
|
io
Package io provides the Chrome DevTools Protocol commands, types, and events for the IO domain.
|
Package io provides the Chrome DevTools Protocol commands, types, and events for the IO domain. |
|
layertree
Package layertree provides the Chrome DevTools Protocol commands, types, and events for the LayerTree domain.
|
Package layertree provides the Chrome DevTools Protocol commands, types, and events for the LayerTree domain. |
|
log
Package log provides the Chrome DevTools Protocol commands, types, and events for the Log domain.
|
Package log provides the Chrome DevTools Protocol commands, types, and events for the Log domain. |
|
media
Package media provides the Chrome DevTools Protocol commands, types, and events for the Media domain.
|
Package media provides the Chrome DevTools Protocol commands, types, and events for the Media domain. |
|
memory
Package memory provides the Chrome DevTools Protocol commands, types, and events for the Memory domain.
|
Package memory provides the Chrome DevTools Protocol commands, types, and events for the Memory domain. |
|
network
Package network provides the Chrome DevTools Protocol commands, types, and events for the Network domain.
|
Package network provides the Chrome DevTools Protocol commands, types, and events for the Network domain. |
|
overlay
Package overlay provides the Chrome DevTools Protocol commands, types, and events for the Overlay domain.
|
Package overlay provides the Chrome DevTools Protocol commands, types, and events for the Overlay domain. |
|
page
Package page provides the Chrome DevTools Protocol commands, types, and events for the Page domain.
|
Package page provides the Chrome DevTools Protocol commands, types, and events for the Page domain. |
|
performance
Package performance provides the Chrome DevTools Protocol commands, types, and events for the Performance domain.
|
Package performance provides the Chrome DevTools Protocol commands, types, and events for the Performance domain. |
|
performancetimeline
Package performancetimeline provides the Chrome DevTools Protocol commands, types, and events for the PerformanceTimeline domain.
|
Package performancetimeline provides the Chrome DevTools Protocol commands, types, and events for the PerformanceTimeline domain. |
|
preload
Package preload provides the Chrome DevTools Protocol commands, types, and events for the Preload domain.
|
Package preload provides the Chrome DevTools Protocol commands, types, and events for the Preload domain. |
|
profiler
Package profiler provides the Chrome DevTools Protocol commands, types, and events for the Profiler domain.
|
Package profiler provides the Chrome DevTools Protocol commands, types, and events for the Profiler domain. |
|
pwa
Package pwa provides the Chrome DevTools Protocol commands, types, and events for the PWA domain.
|
Package pwa provides the Chrome DevTools Protocol commands, types, and events for the PWA domain. |
|
runtime
Package runtime provides the Chrome DevTools Protocol commands, types, and events for the Runtime domain.
|
Package runtime provides the Chrome DevTools Protocol commands, types, and events for the Runtime domain. |
|
security
Package security provides the Chrome DevTools Protocol commands, types, and events for the Security domain.
|
Package security provides the Chrome DevTools Protocol commands, types, and events for the Security domain. |
|
serviceworker
Package serviceworker provides the Chrome DevTools Protocol commands, types, and events for the ServiceWorker domain.
|
Package serviceworker provides the Chrome DevTools Protocol commands, types, and events for the ServiceWorker domain. |
|
storage
Package storage provides the Chrome DevTools Protocol commands, types, and events for the Storage domain.
|
Package storage provides the Chrome DevTools Protocol commands, types, and events for the Storage domain. |
|
systeminfo
Package systeminfo provides the Chrome DevTools Protocol commands, types, and events for the SystemInfo domain.
|
Package systeminfo provides the Chrome DevTools Protocol commands, types, and events for the SystemInfo domain. |
|
target
Package target provides the Chrome DevTools Protocol commands, types, and events for the Target domain.
|
Package target provides the Chrome DevTools Protocol commands, types, and events for the Target domain. |
|
tethering
Package tethering provides the Chrome DevTools Protocol commands, types, and events for the Tethering domain.
|
Package tethering provides the Chrome DevTools Protocol commands, types, and events for the Tethering domain. |
|
tracing
Package tracing provides the Chrome DevTools Protocol commands, types, and events for the Tracing domain.
|
Package tracing provides the Chrome DevTools Protocol commands, types, and events for the Tracing domain. |
|
webaudio
Package webaudio provides the Chrome DevTools Protocol commands, types, and events for the WebAudio domain.
|
Package webaudio provides the Chrome DevTools Protocol commands, types, and events for the WebAudio domain. |
|
webauthn
Package webauthn provides the Chrome DevTools Protocol commands, types, and events for the WebAuthn domain.
|
Package webauthn provides the Chrome DevTools Protocol commands, types, and events for the WebAuthn domain. |
|
Package chromedp is a high level Chrome DevTools Protocol client that simplifies driving browsers for scraping, unit testing, or profiling web pages using the CDP.
|
Package chromedp is a high level Chrome DevTools Protocol client that simplifies driving browsers for scraping, unit testing, or profiling web pages using the CDP. |
|
device
Package device contains device emulation definitions for use with chromedp's Emulate action.
|
Package device contains device emulation definitions for use with chromedp's Emulate action. |
|
kb
Package kb provides keyboard mappings for Chrome DOM Keys for use with input events.
|
Package kb provides keyboard mappings for Chrome DOM Keys for use with input events. |
|
Package httphead contains utils for parsing HTTP and HTTP-grammar compatible text protocols headers.
|
Package httphead contains utils for parsing HTTP and HTTP-grammar compatible text protocols headers. |
|
Package humanize converts boring ugly numbers to human-friendly strings and back.
|
Package humanize converts boring ugly numbers to human-friendly strings and back. |
|
english
Package english provides utilities to generate more user-friendly English output.
|
Package english provides utilities to generate more user-friendly English output. |
|
Package intern interns strings.
|
Package intern interns strings. |
|
cmd/pixelmatch
command
|
|
|
Package pool contains helpers for pooling structures distinguishable by size.
|
Package pool contains helpers for pooling structures distinguishable by size. |
|
pbufio
Package pbufio contains tools for pooling bufio.Reader and bufio.Writers.
|
Package pbufio contains tools for pooling bufio.Reader and bufio.Writers. |
|
pbytes
Package pbytes contains tools for pooling byte pool.
|
Package pbytes contains tools for pooling byte pool. |
|
Package screenresolution is used to retrieve the current screen resolution.
|
Package screenresolution is used to retrieve the current screen resolution. |
|
cmd/boottime
command
|
|
|
Package ws implements a client and server for the WebSocket protocol as specified in RFC 6455.
|
Package ws implements a client and server for the WebSocket protocol as specified in RFC 6455. |
|
autobahn
command
|
|
|
example/autobahn
command
|
|
|
wsutil
Package wsutil provides utilities for working with WebSocket protocol.
|
Package wsutil provides utilities for working with WebSocket protocol. |