// pkg/webview/messages.go package webview import "time" // --- Queries (read-only) --- // QueryURL gets the current page URL. Result: string type QueryURL struct{ Window string `json:"window"` } // QueryTitle gets the current page title. Result: string type QueryTitle struct{ Window string `json:"window"` } // QueryConsole gets captured console messages. Result: []ConsoleMessage type QueryConsole struct { Window string `json:"window"` Level string `json:"level,omitempty"` // filter by type: "log", "warn", "error", "info", "debug" Limit int `json:"limit,omitempty"` // max messages (0 = all) } // QuerySelector finds a single element. Result: *ElementInfo (nil if not found) type QuerySelector struct { Window string `json:"window"` Selector string `json:"selector"` } // QuerySelectorAll finds all matching elements. Result: []*ElementInfo type QuerySelectorAll struct { Window string `json:"window"` Selector string `json:"selector"` } // QueryDOMTree gets HTML content. Result: string (outerHTML) type QueryDOMTree struct { Window string `json:"window"` Selector string `json:"selector,omitempty"` // empty = full document } // --- Tasks (side-effects) --- // TaskEvaluate executes JavaScript. Result: any (JS return value) type TaskEvaluate struct { Window string `json:"window"` Script string `json:"script"` } // TaskClick clicks an element. Result: nil type TaskClick struct { Window string `json:"window"` Selector string `json:"selector"` } // TaskType types text into an element. Result: nil type TaskType struct { Window string `json:"window"` Selector string `json:"selector"` Text string `json:"text"` } // TaskNavigate navigates to a URL. Result: nil type TaskNavigate struct { Window string `json:"window"` URL string `json:"url"` } // TaskScreenshot captures the page as PNG. Result: ScreenshotResult type TaskScreenshot struct{ Window string `json:"window"` } // TaskScroll scrolls to an absolute position (window.scrollTo). Result: nil type TaskScroll struct { Window string `json:"window"` X int `json:"x"` Y int `json:"y"` } // TaskHover hovers over an element. Result: nil type TaskHover struct { Window string `json:"window"` Selector string `json:"selector"` } // TaskSelect selects an option in a