mqtt加入认证,优化视频播放与浏览器
This commit is contained in:
@@ -5,8 +5,6 @@ import (
|
||||
"github.com/go-rod/rod"
|
||||
"github.com/go-rod/rod/lib/launcher"
|
||||
"github.com/go-rod/rod/lib/launcher/flags"
|
||||
"github.com/go-rod/rod/lib/proto"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// OpenApp 用APP模式打开网页
|
||||
@@ -26,18 +24,5 @@ func OpenApp(c context.Context, url string) {
|
||||
b := rod.New().ControlURL(p).MustConnect()
|
||||
defer b.MustClose()
|
||||
|
||||
s := make(chan struct{})
|
||||
|
||||
wait := b.EachEvent(func(e *proto.TargetTargetDestroyed) {
|
||||
zap.S().Infoln("浏览器关闭事件")
|
||||
s <- struct{}{}
|
||||
})
|
||||
go wait()
|
||||
|
||||
select {
|
||||
case <-c.Done():
|
||||
b.MustClose()
|
||||
<-s
|
||||
case <-s:
|
||||
}
|
||||
<-c.Done()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user