energy/cef/cef-v8-bind-browser.go

34 lines
954 B
Go
Raw Normal View History

2023-03-24 15:20:26 +08:00
//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under Apache License Version 2.0, January 2004
//
// https://www.apache.org/licenses/LICENSE-2.0
//
//----------------------------------------
// 基于IPC的字段数据绑定 - 主进程
package cef
2023-03-24 15:51:44 +08:00
import "github.com/energye/energy/pkgs/json"
2023-03-24 15:20:26 +08:00
var bindBrowser *bindBrowserProcess
type bindBrowserProcess struct {
}
2023-03-24 15:51:44 +08:00
func (m *bindBrowserProcess) initBrowserIPC() {
browserIPC.addCallback(func(channelId int64, data json.JSON) bool {
if data != nil && data.IsObject() {
//messageJSON := data.JSONObject()
//messageId := messageJSON.GetIntByKey(ipc_id)// messageId: 同步永远是1
//emitName := messageJSON.GetStringByKey(ipc_event)
//name := messageJSON.GetStringByKey(ipc_name)
//browserId := messageJSON.GetIntByKey(ipc_browser_id)
//argumentList := messageJSON.GetArrayByKey(ipc_argumentList)
}
return false
})
}