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

Consider add some code or event handler before goto page #113

Open
kangyeop opened this issue Feb 7, 2023 · 0 comments
Open

Consider add some code or event handler before goto page #113

kangyeop opened this issue Feb 7, 2023 · 0 comments

Comments

@kangyeop
Copy link

kangyeop commented Feb 7, 2023

Hello!

I want to register an event that clears the alert. Even if I register for beforeScreenshot , the code doesn't reach it because it runs after moving the page.

So I would like to add some code before moving the page like this:

page.on('dialog', async (dialog) => {
       console.log(dialog.message());
       await dialog.dismiss();
});

await page[isHTMLContent ? 'setContent' : 'goto'](input, {
      timeout: timeoutInMilliseconds,
      waitUntil: 'networkidle2',
});
...
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

1 participant