playwright-go
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
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.
It seems to be Twitter's security verification mechanism, not related to playwright.
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,
})
})