Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/camoufoxnative/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (worker *Worker) waitRunnable(ctx context.Context, tab *chatTab) error {
if state.Enabled {
return nil
}
if len(state.Dialogs) > 0 {
if len(state.Dialogs) > 0 || state.Cover != "" {
clicked, err := dismissKnownOverlays(ctx, worker.client, tab.contextID)
if err != nil {
return err
Expand Down
9 changes: 5 additions & 4 deletions internal/camoufoxnative/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,13 @@ func (client *bidiClient) pointer(ctx context.Context, contextID, selector, patt
return true, err
}

// dismissOverlaysExpression 关闭官网已知且可交互的启动弹层
// dismissOverlaysExpression 关闭官网已知且可交互的启动弹层:G1 欢迎对话框、引导浏览浮层与 Cookie 提示条,提示条有拒绝按钮时拒绝,只有确认按钮时确认
const dismissOverlaysExpression = `(() => {` + pageDOMHelpers + `
const selectors = [
'ms-g1-welcome-dialog button[aria-label="Close dialog"]',
'button[aria-label="Close guided tour"]',
'#glue-cookie-notification-bar-1 .glue-cookie-notification-bar__reject'
'ms-g1-welcome-dialog button',
'button.xap-tour-exit-button',
'#glue-cookie-notification-bar-1 .glue-cookie-notification-bar__reject',
'#glue-cookie-notification-bar-1:not(:has(.glue-cookie-notification-bar__reject)) .glue-cookie-notification-bar__accept'
];
let clicked = 0;
for (const selector of selectors) {
Expand Down