Skip to content

Conversation

@JoelEinbinder
Copy link
Contributor

Adds an event for when a page closes.

@aslushnikov
Copy link
Contributor

What's the usecase for this?

@JoelEinbinder
Copy link
Contributor 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.

2 participants