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

feat: page 'close' event #2232

Merged
merged 1 commit into from Mar 28, 2018
Merged

Conversation

JoelEinbinder
Copy link
Collaborator

Adds an event for when a page closes.

@aslushnikov
Copy link
Contributor

What's the usecase for this?

@JoelEinbinder
Copy link
Collaborator Author

JoelEinbinder commented Mar 20, 2018

I run in headful mode, and want to respond to the user closing my app.

Right now I can do

browser.on('targetdestroyed', target => {
if (target === mypage.target()) doSomething();
});

But that felt pretty clunky.

@aslushnikov aslushnikov merged commit d46e157 into puppeteer:master Mar 28, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants