webview

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinuxWebview

type LinuxWebview struct{}

func (*LinuxWebview) AddUserScript

func (w *LinuxWebview) AddUserScript(js string) error

func (*LinuxWebview) Close

func (w *LinuxWebview) Close() error

func (*LinuxWebview) Create

func (w *LinuxWebview) Create(config WindowConfig) error

func (*LinuxWebview) Destroy

func (w *LinuxWebview) Destroy()

func (*LinuxWebview) EnableFileDrop

func (w *LinuxWebview) EnableFileDrop() error

func (*LinuxWebview) Eval

func (w *LinuxWebview) Eval(js string) error

func (*LinuxWebview) Fullscreen

func (w *LinuxWebview) Fullscreen() error

func (*LinuxWebview) GetPosition

func (w *LinuxWebview) GetPosition() (int, int)

func (*LinuxWebview) GetSize

func (w *LinuxWebview) GetSize() (int, int)

func (*LinuxWebview) LoadHTML

func (w *LinuxWebview) LoadHTML(html string) error

func (*LinuxWebview) LoadURL

func (w *LinuxWebview) LoadURL(url string) error

func (*LinuxWebview) Maximize

func (w *LinuxWebview) Maximize() error

func (*LinuxWebview) Minimize

func (w *LinuxWebview) Minimize() error

func (*LinuxWebview) OnMessage

func (w *LinuxWebview) OnMessage(handler func(msg string))

func (*LinuxWebview) Restore

func (w *LinuxWebview) Restore() error

func (*LinuxWebview) Run

func (w *LinuxWebview) Run() error

func (*LinuxWebview) Screenshot

func (w *LinuxWebview) Screenshot() ([]byte, error)

func (*LinuxWebview) SetColorScheme

func (w *LinuxWebview) SetColorScheme(scheme string) error

func (*LinuxWebview) SetContentProtection

func (w *LinuxWebview) SetContentProtection(enabled bool) error

func (*LinuxWebview) SetMaxSize

func (w *LinuxWebview) SetMaxSize(w2, h int) error

func (*LinuxWebview) SetMinSize

func (w *LinuxWebview) SetMinSize(w2, h int) error

func (*LinuxWebview) SetPosition

func (w *LinuxWebview) SetPosition(x, y int) error

func (*LinuxWebview) SetSize

func (w *LinuxWebview) SetSize(w2, h int) error

func (*LinuxWebview) SetTitle

func (w *LinuxWebview) SetTitle(title string) error

func (*LinuxWebview) SetVibrancy

func (w *LinuxWebview) SetVibrancy(style string) error

type Webview

type Webview interface {
	Create(config WindowConfig) error
	LoadHTML(html string) error
	LoadURL(url string) error
	Eval(js string) error
	AddUserScript(js string) error
	SetTitle(title string) error
	SetSize(w, h int) error
	GetSize() (int, int)
	SetMinSize(w, h int) error
	SetMaxSize(w, h int) error
	SetPosition(x, y int) error
	GetPosition() (int, int)
	Fullscreen() error
	Minimize() error
	Maximize() error
	Restore() error
	Close() error
	SetContentProtection(enabled bool) error
	SetVibrancy(style string) error
	SetColorScheme(scheme string) error
	EnableFileDrop() error
	OnMessage(handler func(msg string))
	Screenshot() ([]byte, error)
	Run() error
	Destroy()
}

Webview is the interface for platform-specific webview implementations.

func New

func New() Webview

type WindowConfig

type WindowConfig struct {
	Title       string
	Width       int
	Height      int
	MinWidth    int
	MinHeight   int
	Resizable   bool
	Frameless   bool
	AlwaysOnTop bool
	Transparent bool
	DevTools    bool
}

WindowConfig holds the configuration for creating a webview window.

Jump to

Keyboard shortcuts

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