GoMiniblink

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2020 License: MIT Imports: 16 Imported by: 0

README

介绍

Miniblink的免费版封装,官网:https://miniblink.net/

  1. 不使用CGO
  2. 面向对象
  3. 跨平台设计,但目前只有一个windows实现
  4. 组件和窗体两种模式
  5. JS互操作
  6. 监控与拦截请求
  7. 透明窗体
  8. 支持本地目录加载模式

Go封装的功能比较少,其实就是 https://gitee.com/aochulai/NetMiniblink 的简化版,因为我出Go封装的目标是VIP,所以免费版就懒得像NetMiniblink一样写得那么完善啦,不过VIP版会向NetMiniblink完整度看齐。

PS: 本库fork自aochulai/GoMiniblink

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindJsFunc

func BindJsFunc(fn JsFnBinding)

Types

type ConsoleCallback

type ConsoleCallback func(args ConsoleEvArgs)

type ConsoleEvArgs

type ConsoleEvArgs interface {
	Level() string
	Message() string
	SourceName() string
	SourceLine() int
	StackTrace() string
}

type DocumentReadyCallback

type DocumentReadyCallback func(args DocumentReadyEvArgs)

type DocumentReadyEvArgs

type DocumentReadyEvArgs interface {
	FrameContext
}

type EventDispatcher

type EventDispatcher struct {
	// contains filtered or unexported fields
}

func (*EventDispatcher) Add

func (_this *EventDispatcher) Add(name string, fn interface{})

func (*EventDispatcher) AddEx

func (_this *EventDispatcher) AddEx(fn interface{}) string

func (*EventDispatcher) Clear

func (_this *EventDispatcher) Clear()

func (*EventDispatcher) Fire

func (_this *EventDispatcher) Fire(key string, sender interface{}, param ...interface{})

func (*EventDispatcher) Init

func (_this *EventDispatcher) Init(key string) *EventDispatcher

func (*EventDispatcher) IsEmtpy

func (_this *EventDispatcher) IsEmtpy() bool

func (*EventDispatcher) Remove

func (_this *EventDispatcher) Remove(name string) interface{}

type FileLoader

type FileLoader struct {
	// contains filtered or unexported fields
}

func (*FileLoader) ByUri

func (_this *FileLoader) ByUri(uri *url2.URL) []byte

func (*FileLoader) Domain

func (_this *FileLoader) Domain() string

func (*FileLoader) Init

func (_this *FileLoader) Init(dir, domain string) *FileLoader

type FrameContext

type FrameContext interface {
	FrameId() uintptr
	IsMain() bool
	Url() string
	IsRemote() bool
	RunJs(script string) interface{}
}

type GoFn

type GoFn func(context GoFnContext) interface{}

type GoFnContext

type GoFnContext struct {
	Miniblink Miniblink
	Name      string
	State     interface{}
	Param     []interface{}
}

type JsFnBinding

type JsFnBinding struct {
	Name  string
	Fn    GoFn
	State interface{}
	// contains filtered or unexported fields
}

func (*JsFnBinding) Call

func (_this *JsFnBinding) Call(mb Miniblink, param []interface{}) interface{}

type JsFunc

type JsFunc func(param ...interface{}) interface{}

type JsReadyCallback

type JsReadyCallback func(args JsReadyEvArgs)

type JsReadyEvArgs

type JsReadyEvArgs interface {
	FrameContext
}

type LoadFailEvArgs

type LoadFailEvArgs interface {
	RequestBefore() RequestBeforeEvArgs
}

type LoadResource

type LoadResource interface {
	Domain() string
	ByUri(uri *url2.URL) []byte
}
type Miniblink interface {
	MouseIsEnable() bool
	MouseEnable(b bool)
	ToBitmap() *image.RGBA
	CallJsFunc(name string, param []interface{}) interface{}
	JsFunc(name string, fn GoFn, state interface{})
	RunJs(script string) interface{}
	SetOnConsole(callback ConsoleCallback)
	SetOnJsReady(callback JsReadyCallback)
	SetOnRequestBefore(callback RequestBeforeCallback)
	SetOnDocumentReady(callback DocumentReadyCallback)
	SetOnPaintUpdated(callback PaintUpdatedCallback)
	LoadUri(uri string)
	GetHandle() wkeHandle
}

type MiniblinkBrowser

type MiniblinkBrowser struct {
	cs.Control

	EvRequestBefore map[string]func(sender *MiniblinkBrowser, e RequestBeforeEvArgs)
	OnRequestBefore func(e RequestBeforeEvArgs)

	EvJsReady map[string]func(sender *MiniblinkBrowser, e JsReadyEvArgs)
	OnJsReady func(e JsReadyEvArgs)

	EvConsole map[string]func(sender *MiniblinkBrowser, e ConsoleEvArgs)
	OnConsole func(e ConsoleEvArgs)

	EvDocumentReady map[string]func(sender *MiniblinkBrowser, e DocumentReadyEvArgs)
	OnDocumentReady func(e DocumentReadyEvArgs)

	EvPaintUpdated map[string]func(sender *MiniblinkBrowser, e PaintUpdatedEvArgs)
	OnPaintUpdated func(e PaintUpdatedEvArgs)

	ResourceLoader []LoadResource
	// contains filtered or unexported fields
}

func (*MiniblinkBrowser) CallJsFunc

func (_this *MiniblinkBrowser) CallJsFunc(name string, param ...interface{}) interface{}

func (*MiniblinkBrowser) GetMiniblinkHandle

func (_this *MiniblinkBrowser) GetMiniblinkHandle() uintptr

func (*MiniblinkBrowser) Init

func (_this *MiniblinkBrowser) Init() *MiniblinkBrowser

func (*MiniblinkBrowser) JsFunc

func (_this *MiniblinkBrowser) JsFunc(name string, fn GoFn, state interface{})

func (*MiniblinkBrowser) JsFuncEx

func (_this *MiniblinkBrowser) JsFuncEx(name string, fn interface{})

func (*MiniblinkBrowser) LoadUri

func (_this *MiniblinkBrowser) LoadUri(uri string)

func (*MiniblinkBrowser) MouseEnable

func (_this *MiniblinkBrowser) MouseEnable(b bool)

func (*MiniblinkBrowser) MouseIsEnable

func (_this *MiniblinkBrowser) MouseIsEnable() bool

func (*MiniblinkBrowser) ToBitmap

func (_this *MiniblinkBrowser) ToBitmap() *image.RGBA

type MiniblinkForm

type MiniblinkForm struct {
	cs.Form
	View *MiniblinkBrowser
	// contains filtered or unexported fields
}

func (*MiniblinkForm) Init

func (_this *MiniblinkForm) Init() *MiniblinkForm

func (*MiniblinkForm) TransparentMode

func (_this *MiniblinkForm) TransparentMode()

type PaintUpdatedCallback

type PaintUpdatedCallback func(args PaintUpdatedEvArgs)

type PaintUpdatedEvArgs

type PaintUpdatedEvArgs interface {
	Bitmap() *image.RGBA
	Bound() forms.Bound
	Cancel()
	IsCancel() bool
}

type RequestBeforeCallback

type RequestBeforeCallback func(args RequestBeforeEvArgs)

type RequestBeforeEvArgs

type RequestBeforeEvArgs interface {
	Url() string
	Method() string
	SetData([]byte)
	Data() []byte
	SetCancel(b bool)
	ResetUrl(url string)
	SetHeader(name, value string)
	/**
	内容最终呈现时触发
	args:intf, ResponseEvArgs
	*/
	EvResponse() *EventDispatcher
	/**
	加载失败时触发
	args:intf, LoadFailEvArgs
	*/
	EvLoadFail() *EventDispatcher
	/**
	请求流程全部完成时触发
	args:intf, RequestBeforeEvArgs
	*/
	EvFinish() *EventDispatcher
}

type ResponseCallback

type ResponseCallback func(args ResponseEvArgs)

type ResponseEvArgs

type ResponseEvArgs interface {
	RequestBefore() RequestBeforeEvArgs
	ContentType() string
	SetContentType(contentType string)
	Data() []byte
	SetData(data []byte)
	Headers() map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL