Documentation ¶
Index ¶
- func NewConfigFromViewEvent(w *app.Window, evt app.ViewEvent) webview.Config
- func Plugin(w *app.Window, evt event.Event)
- type CookiesEvent
- type ExecuteJavascriptOp
- type InstallJavascriptOp
- type ListCookieOp
- type ListStorageOp
- type MessageEvent
- type MessageReceiverOp
- type NavigateOp
- type NavigationEvent
- type OffsetOp
- type RectOp
- type RemoveCookieOp
- type RemoveStorageOp
- type SetCookieOp
- type SetStorageOp
- type StorageEvent
- type StorageType
- type TitleEvent
- type WebViewOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfigFromViewEvent ¶
NewConfigFromViewEvent creates a webview.Config based on app.ViewEvent.
Types ¶
type CookiesEvent ¶
type CookiesEvent struct {
Cookies []webview.CookieData
}
CookiesEvent is the event sent when ListCookieOp is executed.
func (CookiesEvent) ImplementsEvent ¶
func (c CookiesEvent) ImplementsEvent()
ImplementsEvent the event.Event interface.
type ExecuteJavascriptOp ¶
type ExecuteJavascriptOp struct {
Script string
}
ExecuteJavascriptOp executes given JavaScript in the webview.
func (ExecuteJavascriptOp) Add ¶
func (o ExecuteJavascriptOp) Add(op *op.Ops)
Add adds a new ExecuteJavascriptOp to the queue.
type InstallJavascriptOp ¶
type InstallJavascriptOp struct {
Script string
}
InstallJavascriptOp installs given JavaScript in the webview, executing it every time the webview loads a new page. The script is executed before the page is fully loaded.
func (InstallJavascriptOp) Add ¶
func (o InstallJavascriptOp) Add(op *op.Ops)
Add adds a new ExecuteJavascriptOp to the queue.
type ListCookieOp ¶
ListCookieOp lists all cookies in the webview. The response in sent via CookiesEvent using the provided Tag.
func (ListCookieOp) Add ¶
func (o ListCookieOp) Add(op *op.Ops)
Add adds a new ListCookieOp to the queue.
type ListStorageOp ¶
type ListStorageOp struct { Local StorageType Tag event.Tag }
ListStorageOp lists all Storage in the webview. The response in sent via StorageEvent using the provided Tag.
func (ListStorageOp) Add ¶
func (o ListStorageOp) Add(op *op.Ops)
Add adds a new ListStorageOp to the queue.
type MessageEvent ¶
type MessageEvent struct {
Message string
}
MessageEvent is the event sent when receiving a message, from previously defined MessageReceiverOp.
func (MessageEvent) ImplementsEvent ¶
func (c MessageEvent) ImplementsEvent()
ImplementsEvent the event.Event interface.
type MessageReceiverOp ¶
MessageReceiverOp receives a message from the webview, and sends it to the provided Tag. The message is sent as a string.
You can use this to communicate with the webview, by using:
window.callback.<name>(<message>);
Consider that <name> is the provided Name of the callback, and <message> is the message to send to Tag.
For further information, see webview.JavascriptManager.
func (MessageReceiverOp) Add ¶
func (o MessageReceiverOp) Add(op *op.Ops)
Add adds a new ExecuteJavascriptOp to the queue.
type NavigateOp ¶
type NavigateOp struct { string }URL
NavigateOp redirects the last Display to the given URL. If the URL have unknown protocols, or malformed URL may lead to unknown behaviors.
type NavigationEvent ¶
type NavigationEvent webview.NavigationEvent
NavigationEvent is issued when the webview change the URL.
func (NavigationEvent) ImplementsEvent ¶
func (NavigationEvent) ImplementsEvent()
ImplementsEvent the event.Event interface.
type OffsetOp ¶
OffsetOp moves the webview by the specified offset.
type RectOp ¶
RectOp shows the webview into the specified area. The RectOp is not context-aware, and will overlay any other widget on the screen.
RectOp also takes the foreground and clicks events and keyboard events will not be routed to Gio.
Performance: changing the size/bounds or radius can be expensive. If applicable, change the Rect, instead of changing the size.
Only one RectOp can be active at each frame for the same WebViewOp.
type RemoveCookieOp ¶
type RemoveCookieOp struct {
Cookie webview.CookieData
}
RemoveCookieOp sets given cookie in the webview.
func (RemoveCookieOp) Add ¶
func (o RemoveCookieOp) Add(op *op.Ops)
Add adds a new SetCookieOp to the queue.
type RemoveStorageOp ¶
type RemoveStorageOp struct { Local StorageType Content webview.StorageData }
RemoveStorageOp sets given Storage in the webview.
func (RemoveStorageOp) Add ¶
func (o RemoveStorageOp) Add(op *op.Ops)
Add adds a new SetStorageOp to the queue.
type SetCookieOp ¶
type SetCookieOp struct {
Cookie webview.CookieData
}
SetCookieOp sets given cookie in the webview.
func (SetCookieOp) Add ¶
func (o SetCookieOp) Add(op *op.Ops)
Add adds a new SetCookieOp to the queue.
type SetStorageOp ¶
type SetStorageOp struct { Local StorageType Content webview.StorageData }
SetStorageOp sets given Storage in the webview.
func (SetStorageOp) Add ¶
func (o SetStorageOp) Add(op *op.Ops)
Add adds a new SetStorageOp to the queue.
type StorageEvent ¶
type StorageEvent struct {
Storage []webview.StorageData
}
StorageEvent is the event sent when ListStorageOp is executed.
func (StorageEvent) ImplementsEvent ¶
func (c StorageEvent) ImplementsEvent()
ImplementsEvent the event.Event interface.
type StorageType ¶
type StorageType int
StorageType is the type of storage.
const ( // StorageTypeLocal is the local storage. StorageTypeLocal StorageType = iota // StorageTypeSession is the session storage. StorageTypeSession )
type TitleEvent ¶
type TitleEvent webview.TitleEvent
TitleEvent is issued when the webview change the title.
func (TitleEvent) ImplementsEvent ¶
func (TitleEvent) ImplementsEvent()
ImplementsEvent the event.Event interface.
type WebViewOp ¶
type WebViewOp struct {
// contains filtered or unexported fields
}
WebViewOp shows the webview into the specified area. The RectOp is not context-aware, and will overlay any other widget on the screen.
WebViewOp also takes the foreground and clicks events and keyboard events will not be routed to Gio.
Performance: changing the size/bounds or radius can be expensive. If applicable, change the Offset, instead of changing the size.