init code

This commit is contained in:
johlanse 2021-11-12 16:44:19 +08:00
parent 412120689c
commit 8fe277be6f
2 changed files with 6 additions and 5 deletions

View File

@ -17,6 +17,7 @@ type Core struct {
pw *playwright.Playwright
browser playwright.Browser
context playwright.BrowserContext
ShowBrowser bool
}
type cookie struct {
@ -62,7 +63,7 @@ func (c *Core) Init() {
HandleSIGHUP: nil,
HandleSIGINT: nil,
HandleSIGTERM: nil,
Headless: playwright.Bool(false),
Headless: playwright.Bool(c.ShowBrowser),
Proxy: nil,
SlowMo: nil,
Timeout: nil,

View File

@ -48,7 +48,7 @@ func main() {
2只刷文章和视频和每日答题
3刷文章和视频和每日答题每周答题和专项答题`)
log.Infoln("检测到模式", config.Model)
core := lib.Core{}
core := lib.Core{ShowBrowser: config.ShowBrowser}
defer core.Quit()
core.Init()
login, err := core.Login()