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

[Bug]: Setting the useragent in the context will cause the password input of Twitter's Your Account to be invalid when viewing account information #470

Open
twolao opened this issue Jun 20, 2024 · 2 comments

Comments

@twolao
Copy link

twolao commented Jun 20, 2024

Environments

  • playwright-go Version: v0.4201.1
  • Browser: firefox
  • OS and version: macOS

Bug description
after set user-agent, browserscan.net check is ok, only twitter's Your Account to be invalid when viewing account information need to submit password, console hasn't error info, result is cann't go into infopage to.view account information


**Additional context**
Add any other context about the problem here.
@twolao twolao added the p2-bug Something isn't working label Jun 20, 2024
@canstand
Copy link
Collaborator

It seems to be Twitter's security verification mechanism, not related to playwright.

@canstand canstand added p3-collecting-feedback and removed p2-bug Something isn't working labels Jun 20, 2024
@twolao twolao closed this as completed Jun 20, 2024
@twolao twolao reopened this Jun 21, 2024
@twolao
Copy link
Author

twolao commented Jun 21, 2024

It seems to be Twitter's security verification mechanism, not related to playwright.

The following code modifies the useragent and it works fine when submitting the password confirmation on Twitter. However, when using the playwright.BrowserTypeLaunchPersistentContextOptions setting, the above exception will be encountered. Maybe there is a bug in code.

browserContext.Route("**/*", func(route playwright.Route) {
            request := route.Request()
            headers := request.Headers()
            headers["user-agent"] = "my userAgent1.0"
            log.Println("\n\n# ",headers)
            route.Continue(playwright.RouteContinueOptions{
                Headers: headers,
            })
        })

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

No branches or pull requests

2 participants