Documentation ¶
Index ¶
- Variables
- func GetBrowserPath(opt *GoChromeOptions) (string, error)
- func GetHomePath() string
- func IsExist(fileAddr string) bool
- func ReleaseBrowser(opt *GoChromeOptions) error
- func UnPackZip(src, dest string) error
- type ActionTask
- type GoChrome
- func (gc *GoChrome) Bind(jsFuncName string, f interface{}) error
- func (gc *GoChrome) Close()
- func (gc *GoChrome) JsFunc(funcName string, args ...string) reflect.Value
- func (gc *GoChrome) ListenBrowser(fn func(ev interface{}))
- func (gc *GoChrome) ListenTarget(fn func(ev interface{}))
- func (gc *GoChrome) OpenAfter(f func())
- func (gc *GoChrome) Run()
- func (gc *GoChrome) RunUnBackup() error
- func (gc *GoChrome) SetAction(actionArr ActionTask)
- type GoChromeOptions
- type PackageConf
- type Platform
Constants ¶
This section is empty.
Variables ¶
View Source
var ChromeRunCommand map[string]interface{} = map[string]interface{}{ "disable-background-networking": true, "disable-background-timer-throttling": true, "disable-backgrounding-occluded-windows": true, "disable-breakpad": true, "disable-client-side-phishing-detection": true, "disable-default-apps": true, "disable-dev-shm-usage": true, "disable-infobars": true, "disable-extensions": true, "disable-hang-monitor": true, "disable-ipc-flooding-protection": true, "disable-popup-blocking": true, "disable-prompt-on-repost": true, "disable-renderer-backgrounding": true, "disable-sync": true, "disable-translate": true, "disable-windows10-custom-titlebar": true, "metrics-recording-only": true, "no-first-run": true, "no-default-browser-check": true, "safebrowsing-disable-auto-update": true, "enable-automation": false, "password-store": "basic", "use-mock-keychain": true, }
ChromeRunCommand 浏览器启动命令
Functions ¶
func GetBrowserPath ¶ added in v1.1.0
func GetBrowserPath(opt *GoChromeOptions) (string, error)
func GetHomePath ¶ added in v1.1.0
func GetHomePath() string
func ReleaseBrowser ¶
func ReleaseBrowser(opt *GoChromeOptions) error
Types ¶
type ActionTask ¶
type GoChrome ¶
type GoChrome struct { Url string ContextContext context.Context ContextCancelFunc context.CancelFunc Action chromedp.Tasks GoHttp *goHttp // contains filtered or unexported fields }
func Create ¶
func Create(url string, opt ...GoChromeOptions) *GoChrome
func (*GoChrome) ListenBrowser ¶
func (gc *GoChrome) ListenBrowser(fn func(ev interface{}))
func (*GoChrome) ListenTarget ¶
func (gc *GoChrome) ListenTarget(fn func(ev interface{}))
func (*GoChrome) RunUnBackup ¶ added in v1.1.6
func (*GoChrome) SetAction ¶
func (gc *GoChrome) SetAction(actionArr ActionTask)
type GoChromeOptions ¶
type GoChromeOptions struct { AppName string // 应用名称 CliModule bool // 命令行模式 AppModule bool // 应用模式启动 WindowWidth int // 宽度 WindowHeight int // 高度 WindowPositionWidth int // 横向位置 WindowPositionHeight int // 竖向位置 UseHttpServer bool // 是否使用http服务 HttpPort int // http服务的端口 HttpRoute map[string]func(http.ResponseWriter, *http.Request) // 额外的http路由 AssetFile http.FileSystem // 静态资源 RestoreAssets func(dir, name string) error // 解压资源方法 ChromeExecAllocatorOption []chromedp.ExecAllocatorOption // 启动参数 // contains filtered or unexported fields }
GoChromeOptions 启动配置
type PackageConf ¶
type PackageConf struct { Name string `json:"name"` ChromeExecPath string `json:"chrome_exec_path"` IntegratedBrowser bool `json:"integrated_browser"` ChromePackPath Platform `json:"chrome_pack_path"` ChromeVersion Platform `json:"chrome_version"` BuildCachePath string `json:"build_cache_path"` Icons Platform `json:"icons"` RunBuildPath string `json:"run_build_path"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.