Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set up window.nativator.webdriver=undefined? #858

Closed
Xuzan9396 opened this issue Jun 12, 2021 · 3 comments
Closed

How to set up window.nativator.webdriver=undefined? #858

Xuzan9396 opened this issue Jun 12, 2021 · 3 comments

Comments

@Xuzan9396
Copy link

No description provided.

@ZekeLu
Copy link
Member

ZekeLu commented Jun 13, 2021

See #557 (comment)

Closing as dupllicate of #557.

@ZekeLu ZekeLu closed this as completed Jun 13, 2021
@Xuzan9396
Copy link
Author

thank you

err = chromedp.Run(cxt, chromedp.ActionFunc(func(cxt context.Context) error {
   _, err := page.AddScriptToEvaluateOnNewDocument("Object.defineProperty(navigator, 'webdriver', { get: () => false, });").Do(cxt)
   if err != nil {
      return err
   }
   return nil
}))
if err != nil {
   fmt.Println(err)
}

@ZekeLu
Copy link
Member

ZekeLu commented Jun 23, 2021

No. Try the enable-automation flag.

// ...
opts := append(chromedp.DefaultExecAllocatorOptions[:],
	chromedp.Flag("enable-automation", false),
)
ctx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
// ...

Update: chromedp.Flag("enable-automation", false) alone does no work since Chromium 79.0.3922.0. #858 (comment) is better. See #881 (comment) for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants