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

Add page.on('domcontentloaded', callback) #1580

Closed
webnard opened this issue Dec 11, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@webnard
Copy link
Contributor

commented Dec 11, 2017

The page object has the ability to .wait() for the DOMContentLoaded event. It also emits the 'load' event.

It'd be nice to have a way to listen for the DOMContentLoaded event on the main frame, whether through page.on('domcontentloaded', ...) or through page.mainFrame().on('domcontentloaded', ...).

There are cases where I want to evaluate the DOM as soon as it's ready on every navigation, and injecting JavaScript to handle it or having to call certain methods after every goto(url, {waitUntil: 'domcontentloaded'}) is cumbersome. Emitting the DOMContentLoaded would keep things consistent between the goto() wait options and what is currently offered by the page's event emitter.

@sradu

This comment has been minimized.

Copy link

commented Dec 12, 2017

+1

@aslushnikov aslushnikov added the feature label Jan 4, 2018

webnard added a commit to VidAngel/puppeteer that referenced this issue Jan 5, 2018

aslushnikov added a commit that referenced this issue Jan 17, 2018

brigand added a commit to brigand/puppeteer that referenced this issue Feb 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.