playwright-go icon indicating copy to clipboard operation
playwright-go copied to clipboard

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

Open twolao opened this issue 1 year ago • 2 comments

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 avatar Jun 20 '24 02:06 twolao

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

canstand avatar Jun 20 '24 03:06 canstand

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,
            })
        })

twolao avatar Jun 21 '24 01:06 twolao