lib

package
v0.0.0-...-791b82a Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanPath

func CleanPath(v string) string

Removes .. and / prefix from a string value.

func EncodeData

func EncodeData(v []byte, fileExt string) string

Generate browser HTTP data: URL

func InitScript

func InitScript() string

Returns WebView injection JavaScript.

func StrToBool

func StrToBool(v string) bool

Converts a valid string value to boolean.

Types

type Browser

type Browser struct {
	WebView webview.WebView
	// contains filtered or unexported fields
}

func NewBrowser

func NewBrowser(htmlMarkup string, settings BrowserSettings) *Browser

NewBrowser creates a WebView instance.

func (*Browser) BindFuncReturn

func (browser *Browser) BindFuncReturn(funcName string, callback BrowserFuncReturn)

Bind JavaScript function to DOM Window (return string).

func (*Browser) BindFuncVoid

func (browser *Browser) BindFuncVoid(funcName string, callback BrowserFuncVoid)

Bind JavaScript function to DOM Window (no return, void).

func (*Browser) Close

func (browser *Browser) Close()

Close the WebView window.

func (*Browser) LoadHtml

func (browser *Browser) LoadHtml(doc string)

Load HTML document in the WebView window.

func (*Browser) LoadScript

func (browser *Browser) LoadScript(js string)

Load JavaScript during page initialization event.

func (*Browser) Open

func (browser *Browser) Open()

Launch the WebView window.

func (*Browser) SetTitle

func (browser *Browser) SetTitle(v string)

Set the WebView window title.

type BrowserFuncReturn

type BrowserFuncReturn func(arg ...string) string

type BrowserFuncVoid

type BrowserFuncVoid func(arg ...string)

type BrowserSettings

type BrowserSettings struct {
	Title  string
	Height int
	Width  int
	Resize bool
	Debug  bool
}

Browser declared data types.

Jump to

Keyboard shortcuts

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