messaging

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(parserService *services.ParserService, browserService *services.BrowserService) *Handler

NewHandler creates a new message handler

func (*Handler) Handle

func (h *Handler) Handle(payload string)

Handle processes incoming script messages

func (*Handler) SetNavigationController added in v0.9.0

func (h *Handler) SetNavigationController(controller *control.NavigationController)

SetNavigationController injects the navigation controller for unified navigation flow.

func (*Handler) SetWebView

func (h *Handler) SetWebView(webView *webkit.WebView)

SetWebView sets the WebView reference (needed for script injection)

func (*Handler) SetWorkspaceObserver added in v0.9.0

func (h *Handler) SetWorkspaceObserver(observer WorkspaceObserver)

SetWorkspaceObserver registers a workspace event observer.

type Message

type Message struct {
	Type      string `json:"type"`
	URL       string `json:"url"`
	Q         string `json:"q"`
	Limit     int    `json:"limit"`
	Offset    int    `json:"offset"`
	Value     string `json:"value"`
	Event     string `json:"event"`
	Action    string `json:"action"`
	Direction string `json:"direction"`
	// History operations
	HistoryID string `json:"historyId"`
	// Request tracking
	RequestID string `json:"requestId"`
	// Popup close tracking
	WebViewID string `json:"webviewId"`
	Reason    string `json:"reason"`
	// Wails fetch bridge
	ID      string          `json:"id"`
	Payload json.RawMessage `json:"payload"`
	// Favorites operations
	Title      string `json:"title"`
	FaviconURL string `json:"faviconURL"`
}

Message represents a script message from the WebView

type WorkspaceObserver added in v0.9.0

type WorkspaceObserver interface {
	OnWorkspaceMessage(source *webkit.WebView, msg Message)
}

Handler processes script messages from the WebView

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL