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

webdriver is true on the new page #2

Closed
zobx opened this issue Jul 25, 2020 · 3 comments
Closed

webdriver is true on the new page #2

zobx opened this issue Jul 25, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@zobx
Copy link

zobx commented Jul 25, 2020

Click on a label to open a new page, and webdriver is true on the new page.

What methods are there to deal with?

@ysmood
Copy link
Member

ysmood commented Jul 25, 2020

For some reference: puppeteer/puppeteer#3667

waitForDebuggerOnStart is the key to solve it perfectly.

@NormalPunch NormalPunch self-assigned this Jul 27, 2020
@NormalPunch NormalPunch added the good first issue Good for newcomers label Jul 27, 2020
@ysmood ysmood added enhancement New feature or request and removed good first issue Good for newcomers labels Jul 27, 2020
ysmood added a commit to go-rod/rod that referenced this issue Aug 4, 2020
@go-rod go-rod deleted a comment from NormalPunch Aug 4, 2020
@ysmood
Copy link
Member

ysmood commented Aug 4, 2020

@Abin01 I add a new function to support it, the unit test shows how to use it:

https://github.com/go-rod/rod/blob/899b00ac27e25786f0a6820a35164436b24bf21c/page_test.go#L251-L265

Some pseudo-code to demo how to use it with bypass lib:

func main() {
	wait, resume := page.WaitPauseOpen()

	go page.Element("a").Click()

	newPage := wait()

	newPage.EvalOnNewDocument(bypass.JS)
	resume()
}

@ysmood
Copy link
Member

ysmood commented Aug 4, 2020

I will close it for now. If you have any problems please let us know.

@ysmood ysmood closed this as completed Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants