Documentation
¶
Index ¶
- Constants
- Variables
- func CEFString(original string) (final *C.cef_string_t)
- func CEFToGoString(source *C.cef_string_t) string
- func DeleteAllCookiesExec()
- func ExecuteProcess(appHandle unsafe.Pointer) int
- func FillMainArgs(mainArgs *C.struct__cef_main_args_t, appHandle unsafe.Pointer)
- func FillWindowInfo(windowInfo *C.cef_window_info_t, hwnd unsafe.Pointer)
- func Initialize(settings Settings) int
- func OnUIThread() bool
- func PostTask(thread ThreadId, t TaskToExecute)
- func QuitMessageLoop()
- func RegisterV8Callback(name string, callback V8Callback)
- func RegisterV8CallbackHandler(name string, callback V8CallbackHandler)
- func RegisterV8Handler(name string, handler V8Handler)
- func RunMessageLoop()
- func SafeExecuteJavaScript(browser *C.cef_browser_t, code, url string, startLine int)
- func SetConsoleHandler(handler ConsoleHandlerFunc)
- func SetupCreateBrowserWindowCallback(handler CreateBrowserWindowCallback)
- func Shutdown()
- func TransferStringMapContents(fromMap C.cef_string_map_t) map[string]string
- func TransferStringMapContentsToC(fromMap map[string]string, toMap C.cef_string_map_t)
- func V8ValueToBool(v V8Value) bool
- func V8ValueToInt32(v V8Value) int32
- func V8ValueToString(v V8Value) string
- type Browser
- func (b Browser) Close()
- func (b Browser) DeleteAllCookies()
- func (b Browser) Eval(string_val string) string
- func (b Browser) ExecuteJavaScript(code, url string, startLine int)
- func (b Browser) ExecuteJavaScriptWithResult(code string) string
- func (b Browser) GetCStruct() *C.cef_browser_t
- func (b Browser) GetFocusedFrame() (frame *CefFrame)
- func (b Browser) GetFrame(name string) (frame *CefFrame)
- func (b Browser) GetFrameByIdent(identifier int64) (frame *CefFrame)
- func (b Browser) GetFrameCount() int
- func (b Browser) GetFrameIdentifiers() []int64
- func (b Browser) GetFrameNames() []string
- func (b Browser) GetHost() (host *BrowserHost)
- func (b Browser) GetMainFrame() (frame *CefFrame)
- func (b Browser) GetOpenerWindowHandle() unsafe.Pointer
- func (b Browser) GetRootWindowHandle() unsafe.Pointer
- func (b Browser) GetSource() string
- func (b Browser) GetText() string
- func (b Browser) GetURL() string
- func (b Browser) GetV8Context() *C.cef_v8context_t
- func (b Browser) GetWindowHandle() unsafe.Pointer
- func (b Browser) InjectJs(filename string)
- func (b Browser) LoadString(string_val, url string)
- func (b Browser) LoadURL(url string)
- func (b Browser) SendProcessMessage(target_process C.cef_process_id_t, message *C.struct__cef_process_message_t) int
- func (b Browser) SendProcessMessageTest()
- func (b Browser) TriggerPaint()
- func (b Browser) VisitDOM()
- type BrowserHost
- type BrowserSettings
- type CefCursorHandle
- type CefDOMVisitor
- type CefFrame
- func (self CefFrame) ExecuteJavaScript(code, url string, startLine int)
- func (self CefFrame) ExecuteJavaScriptWithResult(code string) string
- func (self CefFrame) GetBrowser() (browser *Browser)
- func (self CefFrame) GetSource() string
- func (self CefFrame) GetText() string
- func (self CefFrame) GetURL() string
- func (self CefFrame) IsValid() bool
- type CefKeyEvent
- type CefListValue
- func (l *CefListValue) Clear()
- func (l *CefListValue) Copy() (o *CefListValue)
- func (l *CefListValue) GetBool(index int) bool
- func (l *CefListValue) GetDouble(index int) float64
- func (l *CefListValue) GetInt(index int) int
- func (l *CefListValue) GetSize() int
- func (l *CefListValue) GetString(index int) string
- func (l *CefListValue) GetType(index int) C.cef_value_type_t
- func (l *CefListValue) IsOwned() bool
- func (l *CefListValue) IsReadOnly() bool
- func (l *CefListValue) IsValid() bool
- func (l *CefListValue) Remove(index int)
- func (l *CefListValue) SetBool(index int, value bool) bool
- func (l *CefListValue) SetDouble(index int, value float64) bool
- func (l *CefListValue) SetInt(index int, value int) bool
- func (l *CefListValue) SetNull(index int) bool
- func (l *CefListValue) SetSize(size int)
- func (l *CefListValue) SetString(index int, value string) bool
- type CefMouseEvent
- type CefPaintElementType
- type CefProcessMessage
- type CefRect
- type CefScreenInfo
- type CefStringVisitor
- type ConsoleHandlerFunc
- type CreateBrowserWindowCallback
- type DefaultRenderHandler
- func (d *DefaultRenderHandler) GetRootScreenRect(rect *CefRect) int
- func (d *DefaultRenderHandler) GetScreenInfo(info *CefScreenInfo) int
- func (d *DefaultRenderHandler) GetScreenPoint(x, y int, screenX, screenY *int) int
- func (d *DefaultRenderHandler) GetViewRect(rect *CefRect) int
- func (d *DefaultRenderHandler) OnCursorChange(cursor CefCursorHandle)
- func (d *DefaultRenderHandler) OnPaint(paintType CefPaintElementType, dirtyRectsCount int, dirtyRects unsafe.Pointer, ...)
- func (d *DefaultRenderHandler) OnPopupShow(show int)
- func (d *DefaultRenderHandler) OnPopupSize(size *CefRect)
- func (d *DefaultRenderHandler) OnScrollOffsetChanged()
- type LifeSpanHandler
- func (l *LifeSpanHandler) BeforeClose(browser *Browser)
- func (l *LifeSpanHandler) DoClose(browser *Browser) int
- func (l *LifeSpanHandler) OnAfterCreated(browser *Browser)
- func (l *LifeSpanHandler) RegisterAndWaitForBrowser() (browser *Browser, err error)
- func (l *LifeSpanHandler) RunModal(browser *Browser) int
- type MouseButtonType
- type RenderHandler
- type Settings
- type TaskToExecute
- type ThreadId
- type V8Callback
- type V8CallbackHandler
- type V8Handler
- type V8Value
Constants ¶
View Source
const ( LOGSEVERITY_DEFAULT = C.LOGSEVERITY_DEFAULT LOGSEVERITY_VERBOSE = C.LOGSEVERITY_VERBOSE LOGSEVERITY_INFO = C.LOGSEVERITY_INFO LOGSEVERITY_WARNING = C.LOGSEVERITY_WARNING LOGSEVERITY_ERROR = C.LOGSEVERITY_ERROR //LOGSEVERITY_ERROR_REPORT = C.LOGSEVERITY_ERROR_REPORT LOGSEVERITY_DISABLE = C.LOGSEVERITY_DISABLE )
View Source
const ( KEYEVENT_RAWKEYDOWN = 0 KEYEVENT_KEYDOWN = 1 KEYEVENT_KEYUP = 2 KEYEVENT_CHAR = 3 )
C.cef_key_event_type_t
View Source
const ( MBT_LEFT = 0 MBT_MIDDLE = 1 MBT_RIGHT = 2 )
Variables ¶
View Source
var Header map[string]string
View Source
var V8CallbackHandlers map[string]V8CallbackHandler
View Source
var V8Callbacks map[string]V8Callback
View Source
var V8Handlers map[string]V8Handler
Functions ¶
func CEFString ¶
func CEFString(original string) (final *C.cef_string_t)
func CEFToGoString ¶
func CEFToGoString(source *C.cef_string_t) string
func DeleteAllCookiesExec ¶
func DeleteAllCookiesExec()
func ExecuteProcess ¶
func FillMainArgs ¶
func FillMainArgs(mainArgs *C.struct__cef_main_args_t, appHandle unsafe.Pointer)
func FillWindowInfo ¶
func FillWindowInfo(windowInfo *C.cef_window_info_t, hwnd unsafe.Pointer)
func Initialize ¶
func OnUIThread ¶
func OnUIThread() bool
func PostTask ¶
func PostTask(thread ThreadId, t TaskToExecute)
allows you to execute a task on the specified thread
func QuitMessageLoop ¶
func QuitMessageLoop()
func RegisterV8Callback ¶
func RegisterV8Callback(name string, callback V8Callback)
func RegisterV8CallbackHandler ¶
func RegisterV8CallbackHandler(name string, callback V8CallbackHandler)
func RegisterV8Handler ¶
func RunMessageLoop ¶
func RunMessageLoop()
func SafeExecuteJavaScript ¶
func SafeExecuteJavaScript(browser *C.cef_browser_t, code, url string, startLine int)
func SetConsoleHandler ¶
func SetConsoleHandler(handler ConsoleHandlerFunc)
func SetupCreateBrowserWindowCallback ¶
func SetupCreateBrowserWindowCallback(handler CreateBrowserWindowCallback)
func TransferStringMapContents ¶
func TransferStringMapContents(fromMap C.cef_string_map_t) map[string]string
func TransferStringMapContentsToC ¶
func TransferStringMapContentsToC(fromMap map[string]string, toMap C.cef_string_map_t)
func V8ValueToBool ¶
func V8ValueToInt32 ¶
func V8ValueToString ¶
Types ¶
type Browser ¶
type Browser struct { Id int RenderHandler RenderHandler // contains filtered or unexported fields }
func BrowserById ¶
func CreateBrowser ¶
func MainBrowser ¶
func (Browser) DeleteAllCookies ¶
func (b Browser) DeleteAllCookies()
func (Browser) ExecuteJavaScript ¶
执行JS
func (Browser) ExecuteJavaScriptWithResult ¶
`var cefEvalFunc = function() { return 1; };var cef_result = cefEvalFunc();app.cefResult(cef_result);`
func (Browser) GetCStruct ¶
func (b Browser) GetCStruct() *C.cef_browser_t
func (Browser) GetFocusedFrame ¶
func (Browser) GetFrameByIdent ¶
func (Browser) GetFrameCount ¶
func (Browser) GetFrameIdentifiers ¶
func (Browser) GetFrameNames ¶
func (Browser) GetHost ¶
func (b Browser) GetHost() (host *BrowserHost)
func (Browser) GetMainFrame ¶
func (Browser) GetOpenerWindowHandle ¶
func (Browser) GetRootWindowHandle ¶
func (Browser) GetV8Context ¶
func (b Browser) GetV8Context() *C.cef_v8context_t
This method can only used in Renderer process
func (Browser) GetWindowHandle ¶
func (Browser) LoadString ¶
func (Browser) SendProcessMessage ¶
func (b Browser) SendProcessMessage(target_process C.cef_process_id_t, message *C.struct__cef_process_message_t) int
func (Browser) SendProcessMessageTest ¶
func (b Browser) SendProcessMessageTest()
func (Browser) TriggerPaint ¶
func (b Browser) TriggerPaint()
type BrowserHost ¶
type BrowserHost struct {
// contains filtered or unexported fields
}
func (*BrowserHost) SendKeyEvent ¶
func (h *BrowserHost) SendKeyEvent(event *CefKeyEvent)
func (*BrowserHost) SendMouseClickEvent ¶
func (h *BrowserHost) SendMouseClickEvent(event *CefMouseEvent, buttonType int, mouseUp bool, clickCount int)
// 鼠标左键点击 var event CefMouseEvent event.X = 120 event.Y = 160 event.Modifiers = 0 h.SendMouseClickEvent(&event, MBT_LEFT, false, 1) h.SendMouseClickEvent(&event, MBT_LEFT, true, 1)
func (*BrowserHost) SendMouseMoveEvent ¶
func (h *BrowserHost) SendMouseMoveEvent(event *CefMouseEvent)
func (*BrowserHost) SetFocus ¶
func (h *BrowserHost) SetFocus(focus bool)
type BrowserSettings ¶
type BrowserSettings struct { /// // Controls whether file URLs will have access to all URLs. Also configurable // using the "allow-universal-access-from-files" command-line switch. /// UniversalAccessFromFileUrls bool /// // Controls whether file URLs will have access to other file URLs. Also // configurable using the "allow-access-from-files" command-line switch. /// FileAccessFromFileUrls bool /// // Controls whether web security restrictions (same-origin policy) will be // enforced. Disabling this setting is not recommend as it will allow risky // security behavior such as cross-site scripting (XSS). Also configurable // using the "disable-web-security" command-line switch. /// WebSecurity bool /// // Controls whether WebGL can be used. Note that WebGL requires hardware // support and may not work on all systems even when enabled. Also // configurable using the "disable-webgl" command-line switch. /// Webgl bool /// // Controls whether content that depends on accelerated compositing can be // used. Note that accelerated compositing requires hardware support and may // not work on all systems even when enabled. Also configurable using the // "disable-accelerated-compositing" command-line switch. /// AcceleratedCompositing bool }
func (BrowserSettings) ToCStruct ¶
func (b BrowserSettings) ToCStruct() (cefBrowserSettings *C.struct__cef_browser_settings_t)
type CefCursorHandle ¶
type CefCursorHandle C.cef_cursor_handle_t
type CefDOMVisitor ¶
type CefDOMVisitor struct { CStruct *C.struct__cef_domvisitor_t // contains filtered or unexported fields }
func NewCefDOMVisitor ¶
func NewCefDOMVisitor() *CefDOMVisitor
func (*CefDOMVisitor) Add ¶
func (v *CefDOMVisitor) Add(n int)
func (*CefDOMVisitor) Close ¶
func (v *CefDOMVisitor) Close()
func (*CefDOMVisitor) Done ¶
func (v *CefDOMVisitor) Done()
func (*CefDOMVisitor) Wait ¶
func (v *CefDOMVisitor) Wait()
type CefFrame ¶
type CefFrame struct {
CStruct *C.struct__cef_frame_t
}
func (CefFrame) ExecuteJavaScript ¶
执行JS
func (CefFrame) ExecuteJavaScriptWithResult ¶
`var cefEvalFunc = function() { return 1; };var cef_result = cefEvalFunc();app.cefResult(cef_result);`
func (CefFrame) GetBrowser ¶
type CefKeyEvent ¶
type CefListValue ¶
type CefListValue struct {
CStruct *C.struct__cef_list_value_t
}
func (*CefListValue) Clear ¶
func (l *CefListValue) Clear()
func (*CefListValue) Copy ¶
func (l *CefListValue) Copy() (o *CefListValue)
func (*CefListValue) GetBool ¶
func (l *CefListValue) GetBool(index int) bool
func (*CefListValue) GetDouble ¶
func (l *CefListValue) GetDouble(index int) float64
func (*CefListValue) GetInt ¶
func (l *CefListValue) GetInt(index int) int
func (*CefListValue) GetSize ¶
func (l *CefListValue) GetSize() int
func (*CefListValue) GetString ¶
func (l *CefListValue) GetString(index int) string
func (*CefListValue) GetType ¶
func (l *CefListValue) GetType(index int) C.cef_value_type_t
func (*CefListValue) IsOwned ¶
func (l *CefListValue) IsOwned() bool
func (*CefListValue) IsReadOnly ¶
func (l *CefListValue) IsReadOnly() bool
func (*CefListValue) IsValid ¶
func (l *CefListValue) IsValid() bool
func (*CefListValue) Remove ¶
func (l *CefListValue) Remove(index int)
func (*CefListValue) SetNull ¶
func (l *CefListValue) SetNull(index int) bool
func (*CefListValue) SetSize ¶
func (l *CefListValue) SetSize(size int)
type CefMouseEvent ¶
type CefPaintElementType ¶
type CefPaintElementType C.cef_paint_element_type_t
type CefProcessMessage ¶
type CefProcessMessage struct {
CStruct *C.struct__cef_process_message_t
}
PID_BROWSER, PID_RENDERER
func CefProcessMessageCreate ¶
func CefProcessMessageCreate(name string) (message *CefProcessMessage)
func NewCefProcessMessage ¶
func NewCefProcessMessage(m *C.struct__cef_process_message_t) (message *CefProcessMessage)
func (*CefProcessMessage) Copy ¶
func (m *CefProcessMessage) Copy() (c *CefProcessMessage)
func (*CefProcessMessage) GetArgumentList ¶
func (m *CefProcessMessage) GetArgumentList() (listValue *CefListValue)
func (*CefProcessMessage) GetName ¶
func (m *CefProcessMessage) GetName() string
func (*CefProcessMessage) IsReadOnly ¶
func (m *CefProcessMessage) IsReadOnly() bool
func (*CefProcessMessage) IsValid ¶
func (m *CefProcessMessage) IsValid() bool
type CefScreenInfo ¶
type CefScreenInfo C.cef_screen_info_t
type CefStringVisitor ¶
type CefStringVisitor struct { CStruct *C.struct__cef_string_visitor_t // contains filtered or unexported fields }
func NewCefStringVisitor ¶
func NewCefStringVisitor() *CefStringVisitor
func (*CefStringVisitor) Add ¶
func (v *CefStringVisitor) Add(n int)
func (*CefStringVisitor) Close ¶
func (v *CefStringVisitor) Close()
func (*CefStringVisitor) Done ¶
func (v *CefStringVisitor) Done(err error)
type ConsoleHandlerFunc ¶
Set up the js console handlers
var DefaultConsoleHandler ConsoleHandlerFunc = ConsoleHandlerFunc(func(message, source string, line int) {
logger.Printf("[console:%s %d] %s\n", source, line, message)
})
type DefaultRenderHandler ¶
type DefaultRenderHandler struct {
Browser *Browser
}
func (*DefaultRenderHandler) GetRootScreenRect ¶
func (d *DefaultRenderHandler) GetRootScreenRect(rect *CefRect) int
func (*DefaultRenderHandler) GetScreenInfo ¶
func (d *DefaultRenderHandler) GetScreenInfo(info *CefScreenInfo) int
func (*DefaultRenderHandler) GetScreenPoint ¶
func (d *DefaultRenderHandler) GetScreenPoint(x, y int, screenX, screenY *int) int
func (*DefaultRenderHandler) GetViewRect ¶
func (d *DefaultRenderHandler) GetViewRect(rect *CefRect) int
func (*DefaultRenderHandler) OnCursorChange ¶
func (d *DefaultRenderHandler) OnCursorChange(cursor CefCursorHandle)
func (*DefaultRenderHandler) OnPaint ¶
func (d *DefaultRenderHandler) OnPaint(paintType CefPaintElementType, dirtyRectsCount int, dirtyRects unsafe.Pointer, buffer unsafe.Pointer, width, height int)
func (*DefaultRenderHandler) OnPopupShow ¶
func (d *DefaultRenderHandler) OnPopupShow(show int)
func (*DefaultRenderHandler) OnPopupSize ¶
func (d *DefaultRenderHandler) OnPopupSize(size *CefRect)
func (*DefaultRenderHandler) OnScrollOffsetChanged ¶
func (d *DefaultRenderHandler) OnScrollOffsetChanged()
type LifeSpanHandler ¶
type LifeSpanHandler struct {
// contains filtered or unexported fields
}
func (*LifeSpanHandler) BeforeClose ¶
func (l *LifeSpanHandler) BeforeClose(browser *Browser)
func (*LifeSpanHandler) DoClose ¶
func (l *LifeSpanHandler) DoClose(browser *Browser) int
func (*LifeSpanHandler) OnAfterCreated ¶
func (l *LifeSpanHandler) OnAfterCreated(browser *Browser)
func (*LifeSpanHandler) RegisterAndWaitForBrowser ¶
func (l *LifeSpanHandler) RegisterAndWaitForBrowser() (browser *Browser, err error)
func (*LifeSpanHandler) RunModal ¶
func (l *LifeSpanHandler) RunModal(browser *Browser) int
type MouseButtonType ¶
type MouseButtonType C.cef_mouse_button_type_t
type RenderHandler ¶
type RenderHandler interface { GetRootScreenRect(*CefRect) int GetViewRect(*CefRect) int GetScreenPoint(int, int, *int, *int) int GetScreenInfo(*CefScreenInfo) int OnPopupShow(int) OnPopupSize(*CefRect) OnPaint(CefPaintElementType, int, unsafe.Pointer, unsafe.Pointer, int, int) OnCursorChange(CefCursorHandle) OnScrollOffsetChanged() }
type Settings ¶
type Settings struct { SingleProcess int BrowserSubprocessPath string CommandLineArgsDisabled int UserAgent string CachePath string LogSeverity int LogFile string Locale string ResourcesDirPath string LocalesDirPath string JavaScriptFlags string RemoteDebuggingPort int }
func (*Settings) ToCStruct ¶
func (settings *Settings) ToCStruct() (cefSettings *C.struct__cef_settings_t)
type TaskToExecute ¶
type TaskToExecute func()
type V8Callback ¶
type V8Callback func([]V8Value)
type V8CallbackHandler ¶
type V8CallbackHandler func(*Browser, *CefProcessMessage) interface{}
type V8Value ¶
type V8Value *C.cef_v8value_t
Source Files
¶
- browser.go
- browser_process.go
- cef.go
- cef_base.go
- cef_callbacks.go
- cef_dom_visitor.go
- cef_frame.go
- cef_host.go
- cef_life_span_handler.go
- cef_linux.go
- cef_list_value.go
- cef_process_message.go
- cef_request_handler.go
- cef_string_visitor.go
- cef_types.go
- my_handler.go
- render_handler.go
- render_process.go
- task.go
- v8.go
Click to show internal directories.
Click to hide internal directories.