Documentation ¶
Index ¶
- Constants
- Variables
- func CloseWindows() uintptr
- func Debug() bool
- func GetBound(h win.HWND) win.RECT
- func GetFocus() win.HWND
- func LoadIconFromBytes(iconData []byte)
- func PtrToUtf8(ptr uintptr) string
- func SetDebugMode()
- func SetTop(hWnd win.HWND)
- func StartBlinkMain(url, title, devtoolsPath string, max, mb, ib bool, width, height int) error
- func StrPtr(s string) (uintptr, error)
- func StrToCharPtr(str string) uintptr
- type Blink
- func (b *Blink) Init() *Blink
- func (b *Blink) WkeCreateWebView() WkeHandle
- func (b *Blink) WkeDestroyWebView(wke WkeHandle)
- func (b *Blink) WkeOnAlertBox(wke WkeHandle, callback WkeOnAlertBoxCallback, param uintptr)
- func (b *Blink) WkeOnDocumentReady(wke WkeHandle, callback WkeDocumentReady2Callback, param uintptr)
- func (b *Blink) WkeOnDownload(wke WkeHandle, callback WkeOnDownloadCallback, param uintptr)
- func (b *Blink) WkeOnPaintUpdated(wke WkeHandle, callback WkePaintUpdatedCallback, param uintptr)
- func (b *Blink) WkeSetDebugConfig(wke WkeHandle, debug DebugType, param string)
- func (b *Blink) WkeSetHandle(wke WkeHandle, handle uintptr)
- func (b *Blink) WkeSetNavigationToNewWindowEnable(wke WkeHandle, bl bool)
- func (b *Blink) WkeSetTransparent(wke WkeHandle, enable bool)
- func (b *Blink) WkeSetUserAgent(wke WkeHandle, userAgent string)
- func (b *Blink) WkeUnInit()
- type BlinkView
- func (v *BlinkView) Close()
- func (v *BlinkView) Init(userAgent string)
- func (v *BlinkView) LoadUrl(url string)
- func (v *BlinkView) OnWndProc(hWnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr
- func (v *BlinkView) SetOnNewWindow(callback WkeOnCreateViewCallback)
- func (v *BlinkView) WkeLoadUrlBeginCallback(wke WkeHandle, param, utf8Url uintptr, job WkeNetJob) uintptr
- type DebugType
- type FinishCallback
- type FormProfile
- type JsExecState
- type Key
- type MbSettings
- type ProxyInfo
- type ProxyType
- type SaveCallback
- type WindowType
- type WkeConsoleCallback
- type WkeDidCreateScriptContextCallback
- type WkeDocumentReady2Callback
- type WkeFrame
- type WkeHandle
- type WkeLoadUrlBeginCallback
- type WkeLoadUrlEndCallback
- type WkeLoadUrlFailCallback
- type WkeLoadingFinishCallback
- type WkeNetJob
- type WkeNetResponseCallback
- type WkeOnAlertBoxCallback
- type WkeOnCreateViewCallback
- type WkeOnDownloadCallback
- type WkePaintBitUpdatedCallback
- type WkePaintUpdatedCallback
- type WkePopupDialogSaveNameCallback
- type WkeProxy
- type WkeRequestType
- type WkeSlist
- type WkeString
Constants ¶
View Source
const ( WKE_LBUTTON = 0x01 WKE_RBUTTON = 0x02 WKE_SHIFT = 0x04 WKE_CONTROL = 0x08 WKE_MBUTTON = 0x10 WKE_EXTENDED = 0x0100 WKE_REPEAT = 0x4000 )
View Source
const ( MB_SETTING_PROXY mbSettingMask = 1 MB_ENABLE_NODEJS mbSettingMask = 1 << 3 MB_ENABLE_DISABLE_H5VIDEO mbSettingMask = 1 << 4 MB_ENABLE_DISABLE_PDFVIEW mbSettingMask = 1 << 5 MB_ENABLE_DISABLE_CC mbSettingMask = 1 << 6 MB_ENABLE_ENABLE_EGLGLES2 mbSettingMask = 1 << 7 MB_ENABLE_ENABLE_SWIFTSHAER mbSettingMask = 1 << 8 )
View Source
const ( WKE_LOADING_SUCCEEDED wkeLoadingResult = 0 WKE_LOADING_FAILED wkeLoadingResult = 1 WKE_LOADING_CANCELED wkeLoadingResult = 2 )
View Source
const ( WKE_NAVIGATION_TYPE_LINKCLICK wkeNavigationType = 0 WKE_NAVIGATION_TYPE_FORMSUBMITTE wkeNavigationType = 1 WKE_NAVIGATION_TYPE_BACKFORWARD wkeNavigationType = 2 WKE_NAVIGATION_TYPE_RELOAD wkeNavigationType = 3 WKE_NAVIGATION_TYPE_FORMRESUBMITT wkeNavigationType = 4 WKE_NAVIGATION_TYPE_OTHER wkeNavigationType = 5 )
View Source
const ( PROCESS_CREATE_PROCESS = 0x0080 PROCESS_CREATE_THREAD = 0x0002 PROCESS_DUP_HANDLE = 0x0040 PROCESS_QUERY_INFORMATION = 0x0400 PROCESS_QUERY_LIMITED_INFORMATION = 0x1000 PROCESS_SET_INFORMATION = 0x0200 PROCESS_SET_QUOTA = 0x0100 PROCESS_SUSPEND_RESUME = 0x0800 PROCESS_TERMINATE = 0x0001 PROCESS_VM_OPERATION = 0x0008 PROCESS_VM_READ = 0x0010 PROCESS_VM_WRITE = 0x0020 PROCESS_ALL_ACCESS = (PROCESS_CREATE_PROCESS | PROCESS_CREATE_THREAD | PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION | PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_SET_INFORMATION | PROCESS_SET_QUOTA | PROCESS_SUSPEND_RESUME | PROCESS_TERMINATE | PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ) GENERIC_WRITE = 0x40000000 FILE_SHARE_WRITE = 0x00000002 CREATE_ALWAYS = 0x2 FILE_ATTRIBUTE_NORMAL = 0x80 MiniDumpNormal = 0x00000000 MiniDumpWithDataSegs = 0x00000001 MiniDumpWithFullMemory = 0x00000002 MiniDumpWithHandleData = 0x00000004 MiniDumpFilterMemory = 0x00000008 MiniDumpScanMemory = 0x00000010 MiniDumpWithUnloadedModules = 0x00000020 MiniDumpWithIndirectlyReferencedMemory = 0x00000040 MiniDumpFilterModulePaths = 0x00000080 MiniDumpWithProcessThreadData = 0x00000100 MiniDumpWithPrivateReadWriteMemory = 0x00000200 MiniDumpWithoutOptionalData = 0x00000400 MiniDumpWithFullMemoryInfo = 0x00000800 MiniDumpWithThreadInfo = 0x00001000 MiniDumpWithCodeSegs = 0x00002000 MiniDumpWithoutAuxiliaryState = 0x00004000 MiniDumpWithFullAuxiliaryState = 0x00008000 MiniDumpWithPrivateWriteCopyMemory = 0x00010000 MiniDumpIgnoreInaccessibleMemory = 0x00020000 MiniDumpWithTokenInformation = 0x00040000 MiniDumpWithModuleHeaders = 0x00080000 MiniDumpFilterTriage = 0x00100000 MiniDumpWithAvxXStateContext = 0x00200000 MiniDumpWithIptTrace = 0x00400000 MiniDumpValidTypeFlags = 0x007fffff )
View Source
const ( // Registry key security and access rights. // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms724878.aspx // for details. ALL_ACCESS = 0xf003f CREATE_LINK = 0x00020 CREATE_SUB_KEY = 0x00004 ENUMERATE_SUB_KEYS = 0x00008 EXECUTE = 0x20019 NOTIFY = 0x00010 QUERY_VALUE = 0x00001 READ = 0x20019 SET_VALUE = 0x00002 WOW64_32KEY = 0x00200 WOW64_64KEY = 0x00100 WRITE = 0x20006 )
View Source
const ( // Windows defines some predefined root keys that are always open. // An application can use these keys as entry points to the registry. // Normally these keys are used in OpenKey to open new keys, // but they can also be used anywhere a Key is required. CLASSES_ROOT = Key(syscall.HKEY_CLASSES_ROOT) CURRENT_USER = Key(syscall.HKEY_CURRENT_USER) LOCAL_MACHINE = Key(syscall.HKEY_LOCAL_MACHINE) USERS = Key(syscall.HKEY_USERS) CURRENT_CONFIG = Key(syscall.HKEY_CURRENT_CONFIG) PERFORMANCE_DATA = Key(syscall.HKEY_PERFORMANCE_DATA) )
Variables ¶
View Source
var ( DllName = "node" // TempPath 临时目录,用于存放临时文件如:dll,cookie等 TempPath = filepath.Join(os.TempDir(), "blink") )
Functions ¶
func CloseWindows ¶
func CloseWindows() uintptr
func LoadIconFromBytes ¶
func LoadIconFromBytes(iconData []byte)
LoadIconFromBytes 先把ico二进制数据存到本地(common.TempPath),再使用winapi的LoadImage加载图标
func SetDebugMode ¶
func SetDebugMode()
func StartBlinkMain ¶
func StrToCharPtr ¶
Types ¶
type Blink ¶
type Blink struct {
// contains filtered or unexported fields
}
var (
WebView *Blink
)
func (*Blink) WkeCreateWebView ¶
func (*Blink) WkeDestroyWebView ¶
func (*Blink) WkeOnAlertBox ¶
func (b *Blink) WkeOnAlertBox(wke WkeHandle, callback WkeOnAlertBoxCallback, param uintptr)
func (*Blink) WkeOnDocumentReady ¶
func (b *Blink) WkeOnDocumentReady(wke WkeHandle, callback WkeDocumentReady2Callback, param uintptr)
func (*Blink) WkeOnDownload ¶
func (b *Blink) WkeOnDownload(wke WkeHandle, callback WkeOnDownloadCallback, param uintptr)
func (*Blink) WkeOnPaintUpdated ¶
func (b *Blink) WkeOnPaintUpdated(wke WkeHandle, callback WkePaintUpdatedCallback, param uintptr)
func (*Blink) WkeSetDebugConfig ¶
设置一些实验性选项。debugString可用参数有:
func (*Blink) WkeSetHandle ¶
func (*Blink) WkeSetNavigationToNewWindowEnable ¶
func (*Blink) WkeSetTransparent ¶
func (*Blink) WkeSetUserAgent ¶
type BlinkView ¶
type BlinkView struct { Proc uintptr DevtoolsPath string // contains filtered or unexported fields }
func (*BlinkView) SetOnNewWindow ¶
func (v *BlinkView) SetOnNewWindow(callback WkeOnCreateViewCallback)
type FinishCallback ¶
type FormProfile ¶
type FormProfile struct { Title string UserAgent string Width int Height int Max bool Mb bool Ib bool Index string DevtoolsPath string Subs map[string]FormProfile Main bool }
func (FormProfile) NewBlinkWindow ¶
func (fp FormProfile) NewBlinkWindow()
type JsExecState ¶
type JsExecState uintptr
type Key ¶
Key is a handle to an open Windows registry key. Keys can be obtained by calling OpenKey; there are also some predefined root keys such as CURRENT_USER. Keys can be used directly in the Windows API.
type MbSettings ¶
type MbSettings struct { Mask mbSettingMask // contains filtered or unexported fields }
type SaveCallback ¶
type SaveCallback func(url, path string)
type WindowType ¶
type WindowType int
const ( WKE_WINDOW_TYPE_POPUP WindowType = iota WKE_WINDOW_TYPE_TRANSPARENT WKE_WINDOW_TYPE_CONTROL )
type WkeConsoleCallback ¶
type WkeLoadUrlBeginCallback ¶
type WkeLoadUrlEndCallback ¶
type WkeLoadUrlFailCallback ¶
type WkeNetResponseCallback ¶
type WkeOnAlertBoxCallback ¶
type WkeOnCreateViewCallback ¶
type WkeOnDownloadCallback ¶
type WkePaintUpdatedCallback ¶
type WkeRequestType ¶
type WkeRequestType int
Click to show internal directories.
Click to hide internal directories.