Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// WindowConfig keeps configurations about the window
WindowConfig *WindowConfig
// TransportConfig keeps configurations about the network traffic
TransportConfig *TransportConfig
// URL defines the default page.
URL string
// Debug if is non-zero the Developer Tools will be enabled (if supported).
Debug bool
}
Config are used to set the initial and default values to the WebView.
type TransportConfig ¶
type TransportConfig struct {
// Proxy defines the proxy which the connection will be pass through.
Proxy *HTTPProxy
// InsecureBypassCustomProxy if true it might ignore the Proxy settings provided, if fails it to be used. Otherwise
// it could return ErrFeatureNotSupported or ErrImpossibleProxy when create the WebView.
//
// It doesn't have any effect if Proxy is undefined (nil).
// WARNING: It's might be danger if you define an custom Proxy, since it expose the connection without any proxy.
InsecureIgnoreCustomProxy bool
// Authorities defines custom authorities that your app trusts. It could be combined with standard authorities from
// the machine, it might adds the certificate persistent on the user machine and might requires user interaction
// to approve such action.
CertificateAuthorities []x509.Certificate
// IgnoreNetworkIsolation if true will load pages from the local-network (such as 127.0.0.1).
IgnoreNetworkIsolation bool
}
WindowConfig describes topics related to the network traffic.
type Visibility ¶
type Visibility int
Visibility are used to configure if the window mode (maximized or minimized)
const ( // VisibilityDefault will open the window at their default WindowMode VisibilityDefault Visibility = iota // VisibilityMaximized will open the window as maximized // Windowless systems (like Android) will open as fullscreen VisibilityMaximized // VisibilityMinimized will open the window as minimized // Windowless systems (like Android) will hides the webview (return the previous view) VisibilityMinimized )
type WebView ¶
type WebView interface {
// Run runs the main loop until it's terminated. After this function exits -
// you must destroy the webview.
Run()
// Terminate stops the main loop. It is safe to call this function from
// a background thread.
Terminate()
// Destroy destroys a webview and closes the native window.
Destroy()
// Window returns a native window handle pointer. When using GTK backend the
// pointer is GtkWindow pointer, when using Cocoa backend the pointer is
// NSWindow pointer, when using Win32 backend the pointer is HWND pointer.
Window() uintptr
// SetTitle updates the title of the native window. Must be called from the UI
// thread.
SetTitle(title string)
// SetSize updates native window size. See Hint constants.
SetSize(point *Point, hint Hint)
// Navigate navigates webview to the given URL. URL may be a data URI, i.e.
// "data:text/text,<html>...</html>".
SetURL(url string)
// SetVisibility updates the WindowMode, such as minimized or maximized
SetVisibility(v Visibility)
}
WebView is the interface implemented by each webview.
type WindowConfig ¶
type WindowConfig struct {
// Title defines the title of the window.
Title string
// Size defines the Width x Height of the window.
Size *Point
// Path defines the path where the DLL will be exported.
Path string
// Visibility defines how the page must open.
Visibility Visibility
// Window defines the window handle (GtkWindow, NSWindow, HWND pointer or View pointer for Android).
// For Gio (Android): it MUST point to `e.View` from `app.ViewEvent`
Window uintptr
// VM defines the JNI VM for Android
// For Gio (Android): it MUST point to `app.JavaVM()`
VM uintptr
}
WindowConfig describes topics related to the Window/View.
Click to show internal directories.
Click to hide internal directories.