Documentation ¶
Index ¶
- func NewConfigFromViewEvent(w *app.Window, evt app.ViewEvent) webview.Config
- type ClearCacheEvent
- type ClearCacheOp
- type CookiesEvent
- type DestroyOp
- type ErrorEvent
- type ExecuteJavascriptOp
- type InstallJavascriptOp
- type ListCookieOp
- type ListStorageOp
- type MessageEvent
- type MessageReceiverOp
- type NavigateOp
- type NavigationEvent
- type OffsetOp
- type RectOp
- type RemoveCookieEvent
- type RemoveCookieOp
- type RemoveStorageEvent
- type RemoveStorageOp
- type SetCookieArrayEvent
- type SetCookieArrayOp
- type SetCookieEvent
- type SetCookieOp
- type SetStorageEvent
- type SetStorageOp
- type StorageEvent
- type StorageType
- type TitleEvent
- type WebViewOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClearCacheEvent ¶
type ClearCacheEvent struct {
Error error
}
ClearCacheEvent is issued when clearing the storage is completed.
func (ClearCacheEvent) ImplementsEvent ¶
func (ClearCacheEvent) ImplementsEvent()
ImplementsEvent implements the event.Event interface.
type ClearCacheOp ¶
ClearCacheOp clears the cache of the webview.
The response in sent via ErrorEvent using the webview as tag. Also, one
func (ClearCacheOp) Add ¶
func (o ClearCacheOp) Add(op *op.Ops)
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 ErrorEvent ¶
type ErrorEvent struct {
// contains filtered or unexported fields
}
ErrorEvent is issued when the webview encounters an error.
func (ErrorEvent) ImplementsEvent ¶
func (ErrorEvent) ImplementsEvent()
ImplementsEvent implements 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 ¶
type ListCookieOp struct { Tag event.Tag // Buffer is the buffer to use for the response, // that may prevent allocations. Buffer []webview.CookieData }
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 { Tag event.Tag Local StorageType // Buffer is the buffer to use for the response, // that may prevent allocations. Buffer []webview.StorageData }
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. The Tag will receive the message as a string, with MessageEvent.
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.
func NewOffsetOp ¶
NewOffsetOp creates a new OffsetOp.
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 RemoveCookieEvent ¶
type RemoveCookieEvent struct {
Error error
}
RemoveCookieEvent is issued when removing a cookie is completed.
func (RemoveCookieEvent) ImplementsEvent ¶
func (RemoveCookieEvent) ImplementsEvent()
ImplementsEvent implements the event.Event interface.
type RemoveCookieOp ¶
type RemoveCookieOp struct { Tag event.Tag 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 RemoveStorageEvent ¶
type RemoveStorageEvent struct {
Error error
}
RemoveStorageEvent is issued when removing a storage is completed.
func (RemoveStorageEvent) ImplementsEvent ¶
func (RemoveStorageEvent) ImplementsEvent()
ImplementsEvent implements the event.Event interface.
type RemoveStorageOp ¶
type RemoveStorageOp struct { Tag event.Tag 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 RemoveStorageOp to the queue.
type SetCookieArrayEvent ¶
type SetCookieArrayEvent struct {
Error error
}
SetCookieArrayEvent is issued when setting a cookie is completed.
func (SetCookieArrayEvent) ImplementsEvent ¶
func (SetCookieArrayEvent) ImplementsEvent()
ImplementsEvent implements the event.Event interface.
type SetCookieArrayOp ¶
type SetCookieArrayOp struct { Tag event.Tag Cookie []webview.CookieData }
SetCookieArrayOp sets the given list of cookies in the webview.
func (SetCookieArrayOp) Add ¶
func (o SetCookieArrayOp) Add(op *op.Ops)
Add adds a new SetCookieOp to the queue.
type SetCookieEvent ¶
type SetCookieEvent struct {
Error error
}
SetCookieEvent is issued when setting a cookie is completed.
func (SetCookieEvent) ImplementsEvent ¶
func (SetCookieEvent) ImplementsEvent()
ImplementsEvent implements the event.Event interface.
type SetCookieOp ¶
type SetCookieOp struct { Tag event.Tag 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 SetStorageEvent ¶
type SetStorageEvent struct {
Error error
}
SetStorageEvent is issued when setting a storage is completed.
func (SetStorageEvent) ImplementsEvent ¶
func (SetStorageEvent) ImplementsEvent()
ImplementsEvent implements the event.Event interface.
type SetStorageOp ¶
type SetStorageOp struct { Tag event.Tag 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 ¶
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.