Documentation ¶
Index ¶
- Constants
- func AssertType[T interface{}](ptr uintptr) *T
- func BoolToPtr(b bool) uintptr
- func CallbackToPtr(callback interface{}) uintptr
- func CopyBytes(src uintptr, n int) []byte
- func CopyString(src uintptr, n int) string
- func Float32FromBytes(src []byte, startIndex int, isLittleEndian bool) (float32, error)
- func Float32ToBytes(value float32) []byte
- func Float64FromBytes(src []byte, startIndex int, isLittleEndian bool) (float64, error)
- func Float64ToBytes(value float64) []byte
- func HIWORD(dwValue uint32) uint16
- func Int16FromBytes(src []byte, startIndex int, isLittleEndian bool) (int16, error)
- func Int16ToBytes(value int16) []byte
- func Int32FromBytes(src []byte, startIndex int, isLittleEndian bool) (int32, error)
- func Int32ToBytes(value int32) []byte
- func Int64FromBytes(src []byte, startIndex int, isLittleEndian bool) (int64, error)
- func Int64ToBytes(value int64) []byte
- func IntFromBytes(src []byte, startIndex int, isLittleEndian bool) (int, error)
- func IntToBytes(value int) []byte
- func LOWORD(dwValue uint32) uint16
- func PtrToBool(p uintptr) bool
- func PtrToString(p uintptr) string
- func PtrWCharToString(p uintptr) string
- func StringToPtr(s string) uintptr
- func StringToU16Arr(s string) []uint16
- func StringToWCharPtr(s string) uintptr
- func StringToWcharU16Ptr(s string) *uint16
- func Uint16FromBytes(src []byte, startIndex int, isLittleEndian bool) (uint16, error)
- func Uint16ToBytes(value uint16) []byte
- func Uint32FromBytes(src []byte, startIndex int, isLittleEndian bool) (uint32, error)
- func Uint32ToBytes(value uint32) []byte
- func Uint64FromBytes(src []byte, startIndex int, isLittleEndian bool) (uint64, error)
- func Uint64ToBytes(value uint64) []byte
- func UintFromBytes(src []byte, startIndex int, isLittleEndian bool) (uint, error)
- func UintToBytes(value uint) []byte
- func WithCookieFile(path string) func(*Config)
- func WithDllFile(dllFile string) func(*Config)
- func WithDownloader(downloader *dl.Downloader) func(*Config)
- func WithStoragePath(path string) func(*Config)
- func WithTempPath(path string) func(*Config)
- type AnyPtr
- type BOOL
- type BindFunctionCallback
- type Blink
- func (mb *Blink) AddBootScript(script string)
- func (mb *Blink) AddJob(job func()) chan bool
- func (mb *Blink) AddLoop(job ...func()) *Blink
- func (mb *Blink) CallFunc(funcName string, args ...uintptr) (r1 uintptr, r2 uintptr, err error)
- func (mb *Blink) CallFuncAsync(funcName string, args ...uintptr) *CallFuncJob
- func (mb *Blink) CallFuncAsyncFirst(funcName string, args ...uintptr) *CallFuncJob
- func (mb *Blink) CallFuncFirst(funcName string, args ...uintptr) (r1 uintptr, r2 uintptr, err error)
- func (mb *Blink) CloseAll()
- func (mb *Blink) CreateWebWindowControl(parent *View, withConfig ...WithWebWindowConfig) *View
- func (mb *Blink) CreateWebWindowPopup(withConfig ...WithWebWindowConfig) *View
- func (mb *Blink) CreateWebWindowTransparent(withConfig ...WithWebWindowConfig) *View
- func (mb *Blink) Download(url string, withOption ...func(*downloader.Config)) (targetFile string, err error)
- func (mb *Blink) Exit()
- func (mb *Blink) Free()
- func (mb *Blink) GetCookies() ([]*http.Cookie, error)
- func (mb *Blink) GetFirstView() (view *View)
- func (mb *Blink) GetString(str WkeString) string
- func (mb *Blink) GetViewByHandle(viewHwnd WkeHandle) (view *View, exist bool)
- func (mb *Blink) GetViewByJsExecState(es JsExecState) (view *View, exist bool)
- func (mb *Blink) GetViews() []*View
- func (mb *Blink) GetWindowByHandle(windowHwnd WkeHandle) (window *Window, exist bool)
- func (mb *Blink) KeepRunning()
- func (mb *Blink) LoopWinMessage()
- func (mb *Blink) NetGetMIMEType(job WkeNetJob, mime string) string
- func (mb *Blink) NetHookRequest(job WkeNetJob)
- func (mb *Blink) NetSetData(job WkeNetJob, buf []byte)
- func (mb *Blink) NetSetMIMEType(job WkeNetJob, mimeType string)
- func (mb *Blink) Version() int
- func (mb *Blink) VersionString() string
- type BlinkJob
- type CallFuncJob
- type CallFuncResult
- type Callback
- type Char
- type Config
- type Double
- type Float
- type IPC
- func (ipc *IPC) CallJsFunc(view *View, funcName string, args ...interface{}) async.InProgress[interface{}]
- func (ipc *IPC) Handle(channel string, handler Callback)
- func (ipc *IPC) HasChannel(channel string) (exist bool)
- func (ipc *IPC) Invoke(channel string, args ...interface{}) (interface{}, error)
- func (ipc *IPC) Sent(channel string, args ...interface{}) error
- type IPCMessage
- type Int
- type JS
- func (js *JS) Arg(es JsExecState, argIdx uint32) JsValue
- func (js *JS) ArgCount(es JsExecState) uint32
- func (js *JS) ArgType(es JsExecState, argIdx uint32) JsType
- func (js *JS) Boolean(value bool) JsValue
- func (js *JS) Call(es JsExecState, fn, thisValue JsValue, args []JsValue) JsValue
- func (js *JS) Double(value float64) JsValue
- func (js *JS) EmptyArray(es JsExecState) JsValue
- func (js *JS) EmptyObject(es JsExecState) JsValue
- func (js *JS) Eval(es JsExecState, str string) JsValue
- func (js *JS) Get(es JsExecState, object JsValue, prop string) JsValue
- func (js *JS) GetAt(es JsExecState, object JsValue, index uint32) JsValue
- func (js *JS) GetGlobal(es JsExecState, prop string) JsValue
- func (js *JS) GetKeys(es JsExecState, object JsValue) []string
- func (js *JS) GetLength(es JsExecState, object JsValue) int
- func (js *JS) GetWebView(es JsExecState) WkeHandle
- func (js *JS) GlobalExec(viewHandle WkeHandle) (es JsExecState)
- func (js *JS) Int(value int32) JsValue
- func (js *JS) Set(es JsExecState, object JsValue, prop string, value JsValue)
- func (js *JS) SetAt(es JsExecState, object JsValue, index uint32, value JsValue)
- func (js *JS) SetGlobal(es JsExecState, prop string, value JsValue)
- func (js *JS) SetLength(es JsExecState, object JsValue, length uint32)
- func (js *JS) String(es JsExecState, value string) JsValue
- func (js *JS) ToBoolean(es JsExecState, value JsValue) bool
- func (js *JS) ToDouble(es JsExecState, value JsValue) float64
- func (js *JS) ToGoValue(es JsExecState, value JsValue) interface{}
- func (js *JS) ToJsValue(es JsExecState, value interface{}) JsValue
- func (js *JS) ToString(es JsExecState, value JsValue) string
- func (js *JS) ToTempString(es JsExecState, value JsValue) string
- func (js *JS) TypeOf(val JsValue) JsType
- func (js *JS) Undefined() JsValue
- type JsArg
- type JsData
- type JsExecState
- type JsKeys
- type JsType
- type JsValue
- type KnownCType
- type LangConfig
- type Long
- type LongDouble
- type LongInt
- type LongLong
- type Numeric
- type OnClosingCallback
- type OnConsoleCallback
- type OnDestroyCallback
- type OnDidCreateScriptContextCallback
- type OnDocumentReadyCallback
- type OnDomEventCallback
- type OnDownloadCallback
- type OnLoadUrlBeginCallback
- type OnLoadUrlEndCallback
- type OnOtherLoadCallback
- type OnTitleChangedCallback
- type OnWillReleaseScriptContextCallback
- type PrintSettings
- type ProxyInfo
- type ProxyType
- type SChar
- type SIZE_TYPE
- type Short
- type UChar
- type UInt
- type ULong
- type ULongInt
- type ULongLong
- type UShort
- type Utf8
- type View
- func (v *View) AddEventListener(selector, eventType string, callback func(), preScripts ...string) (stop func())
- func (v *View) CallJsFunc(funcName string, args ...interface{}) async.InProgress[interface{}]
- func (v *View) CloseWindow()
- func (v *View) DestroyWindow()
- func (v *View) DoWhenDidCreateScriptContext(callback func())
- func (v *View) DoWhenDocumentReady(callback func())
- func (v *View) ForceReload()
- func (v *View) GetMainWebFrame() WkeWebFrameHandle
- func (v *View) GetRect() *WkeRect
- func (v *View) GetURL() string
- func (v *View) GetWindowHandle() WkeHandle
- func (v *View) HideWindow()
- func (v *View) IsDidCreateScriptContext() bool
- func (v *View) IsDocumentReady() bool
- func (v *View) IsMainFrame(frameId WkeWebFrameHandle) bool
- func (v *View) LoadURL(url string)
- func (v *View) OnClosing(callback OnClosingCallback) (stop func())
- func (v *View) OnConsole(callback OnConsoleCallback) (stop func())
- func (v *View) OnDestroy(callback OnDestroyCallback) (stop func())
- func (v *View) OnDidCreateScriptContext(callback OnDidCreateScriptContextCallback) (stop func())
- func (v *View) OnDocumentReady(callback OnDocumentReadyCallback) (stop func())
- func (v *View) OnDownload(callback OnDownloadCallback) (stop func())
- func (v *View) OnLoadUrlBegin(callback OnLoadUrlBeginCallback) (stop func())
- func (v *View) OnLoadUrlEnd(callback OnLoadUrlEndCallback) (stop func())
- func (v *View) OnOtherLoad(callback OnOtherLoadCallback) (stop func())
- func (v *View) OnTitleChanged(callback OnTitleChangedCallback) (stop func())
- func (v *View) OnWillReleaseScriptContext(callback OnWillReleaseScriptContextCallback) (stop func())
- func (v *View) Reload() bool
- func (v *View) RemoveEventListener(selector, eventType string)
- func (v *View) Resize(width, height int32)
- func (v *View) RunJS(script string) JsValue
- func (v *View) RunJsByFrame(frame WkeWebFrameHandle, script string) JsValue
- func (v *View) SaveToPDF(writer io.Writer, withSetting ...WithPrintSettings) error
- func (v *View) SaveWebFrameToPDF(frameId WkeWebFrameHandle, writer io.Writer, withSetting ...WithPrintSettings) error
- func (v *View) SetCookieJarFullPath(path string)
- func (v *View) SetHeadlessEnabled(enable bool) *CallFuncJob
- func (v *View) SetLocalStorageFullPath(path string)
- func (v *View) SetTransparent(transparent bool)
- func (v *View) ShowDevTools(devtoolsCallbacks ...func(devtools *View))
- func (v *View) ShowWindow()
- func (v *View) WaitUntilDocumentReady(timeout time.Duration) bool
- type VoidPtr
- type WM_SIZING
- type Wchar_t
- type WebWindowConfig
- type Window
- func (w *Window) Close()
- func (w *Window) CloseAsHideTray()
- func (w *Window) Destroy()
- func (w *Window) EnableBorderResize(enable bool, thicknessOpional ...int32)
- func (w *Window) EnableDragging()
- func (w *Window) EnableTray(setups ...func(*win.NOTIFYICONDATA))
- func (w *Window) Hide()
- func (w *Window) HideCaption()
- func (w *Window) IsMaximized() bool
- func (w *Window) Maximize()
- func (w *Window) Minimize()
- func (w *Window) MinimizeToTray()
- func (w *Window) Move(x, y int32)
- func (w *Window) MoveToCenter()
- func (w *Window) OnActivateApp(callback WindowOnActivateAppCallback) (stop func())
- func (w *Window) OnCreate(callback WindowOnCreateCallback) (stop func())
- func (w *Window) OnSize(callback WindowOnSizeCallback) (stop func())
- func (w *Window) OnSizing(callback WindowOnSizingCallback) (stop func())
- func (w *Window) RemoveTray()
- func (w *Window) Resize(width, height int32)
- func (w *Window) Restore()
- func (w *Window) SetIcon(handle win.HANDLE) error
- func (w *Window) SetIconFromBytes(iconData []byte) error
- func (w *Window) SetIconFromFile(iconFilePath string) error
- func (w *Window) SetTitle(title string)
- func (w *Window) SetWindowPos(x, y, width, height int32)
- func (w *Window) Show()
- func (w *Window) ShowCaption()
- type WindowOnActivateAppCallback
- type WindowOnCreateCallback
- type WindowOnSizeCallback
- type WindowOnSizingCallback
- type WithPrintSettings
- type WithWebWindowConfig
- type WkeConsoleCallback
- type WkeConsoleLevel
- type WkeCreateViewCallback
- type WkeCursorType
- type WkeDidCreateScriptContextCallback
- type WkeDocumentReady2Callback
- type WkeDownloadCallback
- type WkeHandle
- type WkeHttBodyElementType
- type WkeJsNativeFunction
- type WkeKeyFlags
- type WkeLoadUrlBeginCallback
- type WkeLoadUrlEndCallback
- type WkeLoadUrlFailCallback
- type WkeMemBuf
- type WkeMouseFlags
- type WkeNavigationType
- type WkeNetJob
- type WkeNetResponseCallback
- type WkeOnOtherLoadCallback
- type WkeOnShowDevtoolsCallback
- type WkeOtherLoadType
- type WkePaintBitUpdatedCallback
- type WkePostBodyElement
- type WkePostBodyElements
- type WkeRect
- type WkeRequestType
- type WkeResourceType
- type WkeSlist
- type WkeString
- type WkeTempCallbackInfo
- type WkeTitleChangedCallback
- type WkeWebFrameHandle
- type WkeWillReleaseScriptContextCallback
- type WkeWillSendRequestInfo
- type WkeWindowClosingCallback
- type WkeWindowDestroyCallback
- type WkeWindowFeatures
- type WkeWindowType
Constants ¶
const ( JS_MB = "__mb" JS_IPC = "ipc" JS_JS2GO = "__js2go" JS_GO2JS = "__go2js" JS_REGISTER_HANDLER = "__register_handler" )
const ( WM_USER = win.WM_USER WM_TRAYNOTIFY = WM_USER + 1 ID_TRAY = WM_USER + 100 ID_TRAYMENU_RESTORE = WM_USER + 101 ID_TRAYMENU_EXIT = WM_USER + 102 )
const ARCH_BIT = 32 << (^uint(0) >> 63)
Variables ¶
This section is empty.
Functions ¶
func AssertType ¶
func AssertType[T interface{}](ptr uintptr) *T
func CallbackToPtr ¶
func CallbackToPtr(callback interface{}) uintptr
callback = func(args ...uintptr) uintptr
func CopyString ¶
func Float32FromBytes ¶
func Float32ToBytes ¶
func Float64FromBytes ¶
func Float64ToBytes ¶
func Int16FromBytes ¶
func Int16ToBytes ¶
func Int32FromBytes ¶
func Int32ToBytes ¶
func Int64FromBytes ¶
func Int64ToBytes ¶
func IntToBytes ¶
func PtrToString ¶
func PtrWCharToString ¶
func StringToPtr ¶
func StringToU16Arr ¶
func StringToWCharPtr ¶
func StringToWcharU16Ptr ¶
func Uint16FromBytes ¶
func Uint16ToBytes ¶
func Uint32FromBytes ¶
func Uint32ToBytes ¶
func Uint64FromBytes ¶
func Uint64ToBytes ¶
func UintFromBytes ¶
func UintToBytes ¶
func WithCookieFile ¶
func WithDllFile ¶
func WithDownloader ¶
func WithDownloader(downloader *dl.Downloader) func(*Config)
func WithStoragePath ¶
func WithTempPath ¶
Types ¶
type BindFunctionCallback ¶
type BindFunctionCallback func(es JsExecState)
type Blink ¶
type Blink struct { *Config IPC *IPC Resource *resource.Resource // contains filtered or unexported fields }
func (*Blink) AddBootScript ¶
func (*Blink) CallFuncAsync ¶
func (mb *Blink) CallFuncAsync(funcName string, args ...uintptr) *CallFuncJob
func (*Blink) CallFuncAsyncFirst ¶
func (mb *Blink) CallFuncAsyncFirst(funcName string, args ...uintptr) *CallFuncJob
func (*Blink) CallFuncFirst ¶
func (*Blink) CreateWebWindowControl ¶
func (mb *Blink) CreateWebWindowControl(parent *View, withConfig ...WithWebWindowConfig) *View
嵌入在父窗口里的子窗口
func (*Blink) CreateWebWindowPopup ¶
func (mb *Blink) CreateWebWindowPopup(withConfig ...WithWebWindowConfig) *View
普通窗口
func (*Blink) CreateWebWindowTransparent ¶
func (mb *Blink) CreateWebWindowTransparent(withConfig ...WithWebWindowConfig) *View
透明窗口
func (*Blink) Download ¶
func (mb *Blink) Download(url string, withOption ...func(*downloader.Config)) (targetFile string, err error)
alias, 缩短代码
func (*Blink) GetFirstView ¶
func (*Blink) GetViewByHandle ¶
func (*Blink) GetViewByJsExecState ¶
func (mb *Blink) GetViewByJsExecState(es JsExecState) (view *View, exist bool)
func (*Blink) GetWindowByHandle ¶
func (*Blink) KeepRunning ¶
func (mb *Blink) KeepRunning()
func (*Blink) LoopWinMessage ¶
func (mb *Blink) LoopWinMessage()
func (*Blink) NetGetMIMEType ¶
获取response的mime
func (*Blink) NetHookRequest ¶
func (*Blink) NetSetData ¶
调用此函数后,网络层收到数据会存储在一buf内,接收数据完成后响应OnLoadUrlEnd事件.#此调用严重影响性能,慎用。 此函数和wkeNetSetData的区别是,wkeNetHookRequest会在接受到真正网络数据后再调用回调,并允许回调修改网络数据。 而wkeNetSetData是在网络数据还没发送的时候修改。
func (*Blink) NetSetMIMEType ¶
设置response的mime
func (*Blink) VersionString ¶
type CallFuncJob ¶
type CallFuncJob struct {
// contains filtered or unexported fields
}
type CallFuncResult ¶
type Config ¶
type Config struct { // 默认下载器 Downloader *dl.Downloader // contains filtered or unexported fields }
func (*Config) GetCookieFileABS ¶
func (*Config) GetDllFile ¶
func (*Config) GetDllFileABS ¶
func (*Config) GetStoragePath ¶
func (*Config) GetTempPath ¶
type IPC ¶
type IPC struct {
// contains filtered or unexported fields
}
func (*IPC) CallJsFunc ¶
func (ipc *IPC) CallJsFunc(view *View, funcName string, args ...interface{}) async.InProgress[interface{}]
func (*IPC) Handle ¶
GO 注册 Handler
handler 必须为函数,参数任意,返回值最多为2个
- 1个返回值:会自动判断返回值是否为 error
- 2个返回值:第一个为 结果,第二个为 error
func (*IPC) HasChannel ¶
type IPCMessage ¶
type JS ¶
type JS struct {
// contains filtered or unexported fields
}
func (*JS) ArgCount ¶
func (js *JS) ArgCount(es JsExecState) uint32
func (*JS) ArgType ¶
func (js *JS) ArgType(es JsExecState, argIdx uint32) JsType
判断第argIdx个参数的参数类型。argIdx从是个0开始计数的值。如果超出jsArgCount返回的值,将发生崩溃
func (*JS) EmptyArray ¶
func (js *JS) EmptyArray(es JsExecState) JsValue
func (*JS) EmptyObject ¶
func (js *JS) EmptyObject(es JsExecState) JsValue
func (*JS) Eval ¶
func (js *JS) Eval(es JsExecState, str string) JsValue
str的代码会在mb内部自动被包裹在一个function(){}中。所以使用的变量会被隔离 注意:要获取返回值,请写return。
func (*JS) Get ¶
func (js *JS) Get(es JsExecState, object JsValue, prop string) JsValue
如果object是个js的object,则获取prop指定的属性。如果object不是js object类型,则返回 nil
func (*JS) GetAt ¶
func (js *JS) GetAt(es JsExecState, object JsValue, index uint32) JsValue
设置js arrary的第index个成员的值,object必须是js array才有用,否则会返回nil
func (*JS) GetLength ¶
func (js *JS) GetLength(es JsExecState, object JsValue) int
获取js arrary的长度,object必须是js array才有用。
func (*JS) GetWebView ¶
func (js *JS) GetWebView(es JsExecState) WkeHandle
func (*JS) GlobalExec ¶
func (js *JS) GlobalExec(viewHandle WkeHandle) (es JsExecState)
获取页面主frame的jsExecState
func (*JS) Set ¶
func (js *JS) Set(es JsExecState, object JsValue, prop string, value JsValue)
设置object的属性
func (*JS) SetAt ¶
func (js *JS) SetAt(es JsExecState, object JsValue, index uint32, value JsValue)
设置js arrary的第index个成员的值,object必须是js array才有用。
func (*JS) SetGlobal ¶
func (js *JS) SetGlobal(es JsExecState, prop string, value JsValue)
设置window上的属性
func (*JS) ToGoValue ¶
func (js *JS) ToGoValue(es JsExecState, value JsValue) interface{}
func (*JS) ToJsValue ¶
func (js *JS) ToJsValue(es JsExecState, value interface{}) JsValue
func (*JS) ToTempString ¶
func (js *JS) ToTempString(es JsExecState, value JsValue) string
type JsExecState ¶
type JsExecState uintptr
type KnownCType ¶
type LangConfig ¶
type LangConfig struct {
IsLittleEndian bool
}
type OnClosingCallback ¶
type OnClosingCallback func() bool // 返回 false 拒绝关闭窗口
type OnConsoleCallback ¶
type OnDestroyCallback ¶
type OnDestroyCallback func()
type OnDidCreateScriptContextCallback ¶
type OnDidCreateScriptContextCallback func(frame WkeWebFrameHandle, context uintptr, exGroup, worldId int)
type OnDocumentReadyCallback ¶
type OnDocumentReadyCallback func(frame WkeWebFrameHandle)
type OnDomEventCallback ¶
type OnDomEventCallback func()
type OnDownloadCallback ¶
type OnDownloadCallback func(url string)
type OnLoadUrlBeginCallback ¶
type OnLoadUrlEndCallback ¶
type OnOtherLoadCallback ¶
type OnOtherLoadCallback func(loadType WkeOtherLoadType, info *WkeTempCallbackInfo)
type OnTitleChangedCallback ¶
type OnTitleChangedCallback func(title string)
type OnWillReleaseScriptContextCallback ¶
type OnWillReleaseScriptContextCallback func(frameId WkeWebFrameHandle, context uintptr, worldId int)
type PrintSettings ¶
type View ¶
type View struct { Hwnd WkeHandle Window *Window DevTools *View // contains filtered or unexported fields }
func NewView ¶
func NewView(mb *Blink, hwnd WkeHandle, windowType WkeWindowType, parent ...*View) *View
func (*View) AddEventListener ¶
func (v *View) AddEventListener(selector, eventType string, callback func(), preScripts ...string) (stop func())
JS.bind(".mb-minimize-btn", "click", func)
func (*View) CallJsFunc ¶
func (v *View) CallJsFunc(funcName string, args ...interface{}) async.InProgress[interface{}]
func (*View) CloseWindow ¶
func (v *View) CloseWindow()
func (*View) DoWhenDidCreateScriptContext ¶
func (v *View) DoWhenDidCreateScriptContext(callback func())
仅作用于 主frame,会自动判断是否已创建 Script Context,仅执行一次
func (*View) DoWhenDocumentReady ¶
func (v *View) DoWhenDocumentReady(callback func())
仅作用于 主frame,会自动判断是否 document ready,仅执行一次
func (*View) ForceReload ¶
func (v *View) ForceReload()
func (*View) GetMainWebFrame ¶
func (v *View) GetMainWebFrame() WkeWebFrameHandle
func (*View) GetWindowHandle ¶
func (*View) HideWindow ¶
func (v *View) HideWindow()
func (*View) IsDidCreateScriptContext ¶
func (*View) IsDocumentReady ¶
func (*View) IsMainFrame ¶
func (v *View) IsMainFrame(frameId WkeWebFrameHandle) bool
func (*View) OnClosing ¶
func (v *View) OnClosing(callback OnClosingCallback) (stop func())
可以添加多个 callback,将按照加入顺序依次执行
callback 返回 false 拒绝关闭窗口
func (*View) OnConsole ¶
func (v *View) OnConsole(callback OnConsoleCallback) (stop func())
func (*View) OnDestroy ¶
func (v *View) OnDestroy(callback OnDestroyCallback) (stop func())
可以添加多个 callback,将按照加入顺序依次执行
func (*View) OnDidCreateScriptContext ¶
func (v *View) OnDidCreateScriptContext(callback OnDidCreateScriptContextCallback) (stop func())
func (*View) OnDocumentReady ¶
func (v *View) OnDocumentReady(callback OnDocumentReadyCallback) (stop func())
func (*View) OnDownload ¶
func (v *View) OnDownload(callback OnDownloadCallback) (stop func())
下载仅能使用一次,多次使用将覆盖前一个回调函数
func (*View) OnLoadUrlBegin ¶
func (v *View) OnLoadUrlBegin(callback OnLoadUrlBeginCallback) (stop func())
func (*View) OnLoadUrlEnd ¶
func (v *View) OnLoadUrlEnd(callback OnLoadUrlEndCallback) (stop func())
func (*View) OnOtherLoad ¶
func (v *View) OnOtherLoad(callback OnOtherLoadCallback) (stop func())
func (*View) OnTitleChanged ¶
func (v *View) OnTitleChanged(callback OnTitleChangedCallback) (stop func())
func (*View) OnWillReleaseScriptContext ¶
func (v *View) OnWillReleaseScriptContext(callback OnWillReleaseScriptContextCallback) (stop func())
func (*View) RemoveEventListener ¶
func (*View) RunJsByFrame ¶
func (v *View) RunJsByFrame(frame WkeWebFrameHandle, script string) JsValue
可指定 frame,会自动判断是否 document ready
func (*View) SaveToPDF ¶
func (v *View) SaveToPDF(writer io.Writer, withSetting ...WithPrintSettings) error
保存主 WebFrame 的内容到 PDF
func (*View) SaveWebFrameToPDF ¶
func (v *View) SaveWebFrameToPDF(frameId WkeWebFrameHandle, writer io.Writer, withSetting ...WithPrintSettings) error
保存指定 WebFrame 的内容到 PDF
func (*View) SetCookieJarFullPath ¶
设置cookie的全路径+文件名,如“c:\mb\cookie.dat”
func (*View) SetHeadlessEnabled ¶
func (v *View) SetHeadlessEnabled(enable bool) *CallFuncJob
func (*View) SetLocalStorageFullPath ¶
设置local storage的全路径。如“c:\mb\LocalStorage\” 注意:这个接口只能接受目录。
func (*View) SetTransparent ¶
func (*View) ShowDevTools ¶
func (*View) ShowWindow ¶
func (v *View) ShowWindow()
type WebWindowConfig ¶
type WebWindowConfig struct {
WkeRect
}
type Window ¶
type Window struct { Hwnd WkeHandle // contains filtered or unexported fields }
func (*Window) CloseAsHideTray ¶
func (w *Window) CloseAsHideTray()
func (*Window) EnableBorderResize ¶
开启边缘拖动大小功能
func (*Window) EnableDragging ¶
func (w *Window) EnableDragging()
func (*Window) EnableTray ¶
func (w *Window) EnableTray(setups ...func(*win.NOTIFYICONDATA))
func (*Window) IsMaximized ¶
func (*Window) MinimizeToTray ¶
func (w *Window) MinimizeToTray()
func (*Window) MoveToCenter ¶
func (w *Window) MoveToCenter()
func (*Window) OnActivateApp ¶
func (w *Window) OnActivateApp(callback WindowOnActivateAppCallback) (stop func())
Active APP 事件
func (*Window) OnCreate ¶
func (w *Window) OnCreate(callback WindowOnCreateCallback) (stop func())
Create 事件
func (*Window) OnSize ¶
func (w *Window) OnSize(callback WindowOnSizeCallback) (stop func())
Size 事件
func (*Window) OnSizing ¶
func (w *Window) OnSizing(callback WindowOnSizingCallback) (stop func())
Sizing 事件
func (*Window) RemoveTray ¶
func (w *Window) RemoveTray()
func (*Window) SetIconFromBytes ¶
设置窗口图标(从图标二进制数据中). 快捷方法
func (*Window) SetIconFromFile ¶
设置窗口图标(从图标文件中). 快捷方法
type WindowOnCreateCallback ¶
type WindowOnCreateCallback func(*win.CREATESTRUCT)
type WindowOnSizeCallback ¶
type WindowOnSizingCallback ¶
type WithPrintSettings ¶
type WithPrintSettings func(s *PrintSettings)
type WithWebWindowConfig ¶
type WithWebWindowConfig func(c *WebWindowConfig)
type WkeConsoleCallback ¶
type WkeConsoleLevel ¶
type WkeConsoleLevel int
const ( WkeConsoleLevel_Log WkeConsoleLevel = iota + 1 WkeConsoleLevel_Warning WkeConsoleLevel_Error WkeConsoleLevel_Debug WkeConsoleLevel_Info WkeConsoleLevel_RevokedError )
type WkeCreateViewCallback ¶
type WkeCreateViewCallback func(webView WkeHandle, param uintptr, navigationType WkeNavigationType, url WkeString, windowFeatures *WkeWindowFeatures) WkeHandle
type WkeCursorType ¶
type WkeCursorType int
const ( WkeCursorType_Pointer WkeCursorType = iota WkeCursorType_Cross WkeCursorType_Hand WkeCursorType_IBeam WkeCursorType_Wait WkeCursorType_Help WkeCursorType_EastResize WkeCursorType_NorthResize WkeCursorType_NorthEastResize WkeCursorType_NorthWestResize WkeCursorType_SouthResize WkeCursorType_SouthEastResize WkeCursorType_SouthWestResize WkeCursorType_WestResize WkeCursorType_NorthSouthResize WkeCursorType_EastWestResize WkeCursorType_NorthEastSouthWestResize WkeCursorType_NorthWestSouthEastResize WkeCursorType_ColumnResize WkeCursorType_RowResize WkeCursorType_MiddlePanning WkeCursorType_EastPanning WkeCursorType_NorthPanning WkeCursorType_NorthEastPanning WkeCursorType_NorthWestPanning WkeCursorType_SouthPanning WkeCursorType_SouthEastPanning WkeCursorType_SouthWestPanning WkeCursorType_WestPanning WkeCursorType_Move WkeCursorType_VerticalText WkeCursorType_Cell WkeCursorType_ContextMenu WkeCursorType_Alias WkeCursorType_Progress WkeCursorType_NoDrop WkeCursorType_Copy WkeCursorType_None WkeCursorType_NotAllowed WkeCursorType_ZoomIn WkeCursorType_ZoomOut WkeCursorType_Grab WkeCursorType_Grabbing WkeCursorType_Custom )
type WkeDocumentReady2Callback ¶
type WkeDocumentReady2Callback func(view WkeHandle, param uintptr, frame WkeWebFrameHandle) (voidRes uintptr)
type WkeDownloadCallback ¶
type WkeHttBodyElementType ¶
type WkeHttBodyElementType int
枚举类型
const ( WkeHttBodyElementTypeData WkeHttBodyElementType = iota WkeHttBodyElementTypeFile )
type WkeJsNativeFunction ¶
type WkeJsNativeFunction func(es JsExecState, param uintptr) (voidRes uintptr)
type WkeKeyFlags ¶
type WkeKeyFlags int
const ( WkeKeyFlags_Extend WkeKeyFlags = 0x0100 WkeKeyFlags_Repeat WkeKeyFlags = 0x4000 )
type WkeLoadUrlBeginCallback ¶
type WkeLoadUrlEndCallback ¶
type WkeLoadUrlFailCallback ¶
type WkeMemBuf ¶
type WkeMemBuf struct { Unuse int Data unsafe.Pointer // 使用unsafe.Pointer代替void* Length uintptr // 使用uintptr代替size_t(如果Length的值不会超过int的范围,也可以使用int) }
wkeMemBuf 结构体
type WkeMouseFlags ¶
type WkeMouseFlags int
const ( WkeMouseFlags_None WkeMouseFlags = 0 WkeMouseFlags_LBUTTON WkeMouseFlags = 0x01 WkeMouseFlags_RBUTTON WkeMouseFlags = 0x02 WkeMouseFlags_SHIFT WkeMouseFlags = 0x04 WkeMouseFlags_CONTROL WkeMouseFlags = 0x08 WkeMouseFlags_MBUTTON WkeMouseFlags = 0x10 )
type WkeNavigationType ¶
type WkeNavigationType int
const ( WKE_NAVIGATION_TYPE_LINKCLICK WkeNavigationType = iota WKE_NAVIGATION_TYPE_FORMSUBMITTED WKE_NAVIGATION_TYPE_BACKFORWARD WKE_NAVIGATION_TYPE_RELOAD WKE_NAVIGATION_TYPE_FORMRESUBMITTED WKE_NAVIGATION_TYPE_OTHER )
type WkeNetResponseCallback ¶
type WkeOnOtherLoadCallback ¶
type WkeOnOtherLoadCallback func(webView WkeHandle, param uintptr, loadType WkeOtherLoadType, info *WkeTempCallbackInfo) (voidRes uintptr)
type WkeOtherLoadType ¶
type WkeOtherLoadType int
const ( WKE_DID_START_LOADING WkeOtherLoadType = iota WKE_DID_STOP_LOADING WKE_DID_NAVIGATE WKE_DID_NAVIGATE_IN_PAGE WKE_DID_GET_RESPONSE_DETAILS WKE_DID_GET_REDIRECT_REQUEST WKE_DID_POST_REQUEST )
type WkePostBodyElement ¶
type WkePostBodyElement struct { Size int Type WkeHttBodyElementType Data *WkeMemBuf // 假设WkeMemBuf是指针类型 FilePath WkeString // 使用uintptr代替C中的wkeString FileStart int64 FileLength int64 // -1 表示到文件末尾 }
wkePostBodyElement 结构体
type WkePostBodyElements ¶
type WkePostBodyElements struct { Size int Elements []*WkePostBodyElement // 使用切片代替指针的指针和大小 ElementSize uintptr IsDirty bool }
wkePostBodyElements 结构体(使用Go的切片)
type WkeRequestType ¶
type WkeRequestType int
const ( WkeRequestType_Unknow WkeRequestType = iota + 1 WkeRequestType_Get WkeRequestType_Post WkeRequestType_Put )
type WkeResourceType ¶
type WkeResourceType int
枚举类型
const ( WKE_RESOURCE_TYPE_MAIN_FRAME WkeResourceType = iota WKE_RESOURCE_TYPE_SUB_FRAME WKE_RESOURCE_TYPE_STYLESHEET WKE_RESOURCE_TYPE_SCRIPT WKE_RESOURCE_TYPE_IMAGE WKE_RESOURCE_TYPE_FONT_RESOURCE WKE_RESOURCE_TYPE_SUB_RESOURCE WKE_RESOURCE_TYPE_OBJECT WKE_RESOURCE_TYPE_MEDIA WKE_RESOURCE_TYPE_WORKER WKE_RESOURCE_TYPE_SHARED_WORKER WKE_RESOURCE_TYPE_PREFETCH WKE_RESOURCE_TYPE_FAVICON WKE_RESOURCE_TYPE_XHR WKE_RESOURCE_TYPE_PING WKE_RESOURCE_TYPE_SERVICE_WORKER WKE_RESOURCE_TYPE_LAST_TYPE )
type WkeTempCallbackInfo ¶
type WkeTempCallbackInfo struct { Size int Frame WkeWebFrameHandle WillSendRequestInfo *WkeWillSendRequestInfo URL *byte // 在Go中,使用*byte代替const char* (如果字符串以null结尾) PostBody *WkePostBodyElements Job WkeNetJob }
type WkeTitleChangedCallback ¶
type WkeWebFrameHandle ¶
type WkeWebFrameHandle uintptr
type WkeWillSendRequestInfo ¶
type WkeWindowFeatures ¶
type WkeWindowFeatures struct { X int // 窗口x坐标 Y int // 窗口y坐标 Width int // 窗口宽度 Height int // 窗口高度 MenuBarVisible bool // 是否显示菜单栏 StatusBarVisible bool // 是否显示状态栏 ToolBarVisible bool // 是否显示工具栏 LocationBarVisible bool // 是否显示地址栏 ScrollbarsVisible bool // 是否显示滚动条 Resizable bool // 是否可调整大小 Fullscreen bool // 是否全屏显示 }
type WkeWindowType ¶
type WkeWindowType uintptr
const ( // 普通窗口 WKE_WINDOW_TYPE_POPUP WkeWindowType = iota // 透明窗口。mb内部通过layer window实现 WKE_WINDOW_TYPE_TRANSPARENT // 嵌入在父窗口里的子窗口。此时parent需要被设置 WKE_WINDOW_TYPE_CONTROL // 隐藏标题栏 WKE_WINDOW_TYPE_HIDE_CAPTION )