The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Puppeteer’s Page emits events for navigation, network requests, JavaScript diagnostics, dialogs, popups, frames, and workers. Use page.on() for recurring listeners, page.once() for a single event, and page.off() with the original callback to remove a listener. For the authoritative event names and callback payloads, consult the Page API and PageEvent enum; the latter is a next-version reference, so check your installed Puppeteer version before depending on recently added or experimental events.
Attach and remove a Page event listener
Register a listener before the navigation or interaction that may trigger it. This matters especially for one-off events such as a popup: if the event fires before the listener is attached, the listener will not see it.
function logRequest(request) {
console.log('A request was made:', request.url());
}
page.on('request', logRequest); // recurring listener
page.once('load', () => console.log('Page loaded!')); // first matching event only
// Later, remove the recurring listener using the same function reference.
page.off('request', logRequest);
The Page API documents these EventEmitter-style methods. An inline callback can be used with once(), but to remove a recurring listener later, keep a reference to its function rather than creating a new anonymous function for off().
Which Puppeteer Page events are available?
The PageEvent reference groups events by what is happening in the page. The list below reflects the documented event inventory, including issue, which the reference marks experimental. Event availability and payloads may differ across installed Puppeteer versions; verify them in the API documentation for the version your project uses.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
| Area | Events | What they indicate |
|---|---|---|
| Lifecycle | domcontentloaded, load, close |
Document lifecycle milestones or page closure. |
| JavaScript diagnostics | console, pageerror, error |
Console activity, uncaught page exceptions, or a page crash. The console event can include messages produced by page JavaScript, including errors and warnings. |
| Dialogs and new tabs | dialog, popup |
A JavaScript dialog, or a newly opened tab or window. |
| Frames | frameattached, framenavigated, framedetached |
A frame joining the page, navigating, or being removed. |
| Network | request, response, requestfinished, requestfailed, requestservedfromcache |
Request issuance, response arrival, completion, failure, or cache service. |
| Workers and diagnostics | workercreated, workerdestroyed, metrics, issue |
Worker lifecycle, page metrics, or an experimental issue event. |
For each event’s documented callback object and precise meaning, use the PageEvent enum reference. Events do not all pass the same kind of value: examples include HTTPRequest, HTTPResponse, Frame, Dialog, ConsoleMessage, and Page.
Understand request, response, completion, and failure
A request’s events describe a lifecycle, not simply whether the server returned a successful status. In the usual case, Puppeteer emits request, then response when response headers arrive, then requestfinished once the response body has downloaded and the request is complete. If the request fails before completion, Puppeteer emits requestfailed instead of requestfinished.
- Use
requestto observe a request being issued. - Use
responseto inspect the response when it arrives, including its status. - Use
requestfinishedto observe a completed exchange. - Use
requestfailedfor a transport-level failure that prevented completion.
A 404 or 503 is still an HTTP response: it normally leads to requestfinished, not requestfailed. Check HTTPResponse.status() to classify HTTP status codes. A redirect completes the original request and issues another request for the redirected URL. The HTTPRequest API describes request lifecycle and failure concepts; HTTPRequest.failure() may return text such as net::ERR_FAILED, but that text is not guaranteed.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Wait for a popup and inspect its page
A popup event supplies a Page for the new tab or window. Attach the one-time listener before clicking or otherwise triggering the opener action, then wait for the action and popup together.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →const popupPromise = page.waitForEvent('popup');
await page.click('a[target="_blank"]');
const popup = await popupPromise;
console.log(await popup.url());
This pattern uses the Page event wait helper; if your code uses once() directly instead, likewise attach it before triggering the popup. A popup remains in the opener’s BrowserContext, as described by the BrowserContext API.
Handle dialogs without blocking the page
JavaScript alert, prompt, confirm, and beforeunload dialogs trigger dialog. An unresolved dialog can block page execution, so choose whether to accept or dismiss it in the handler.
Rank #3
page.on('dialog', async dialog => {
console.log(dialog.type(), dialog.message());
await dialog.dismiss();
});
Use dialog.accept() when the automation should proceed as if the user accepted; for a prompt, consult the Dialog API for its documented accept options. This example dismisses every dialog, which is suitable only when that is the intended behavior.
Track iframe changes
The parent Page emits frameattached, framenavigated, and framedetached. Their frame payload lets you inspect the frame tree or interact with the relevant child frame.
page.on('framenavigated', frame => {
console.log('Frame navigated:', frame.url());
});
For frame APIs and frame-tree behavior, see the Frame API.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Observe traffic without changing it
Use the ordinary request, response, and completion events when you only need diagnostics. Do not enable request interception just to log traffic: interception changes loading behavior and requires every intercepted request to be resolved.
When you do need to modify, mock, or abort requests, enable interception and resolve each request with continue(), respond(), or abort(). An unresolved intercepted request stalls unless the browser cache completes it, which can leave navigation or resource loading hanging.
await page.setRequestInterception(true);
page.on('request', async request => {
try {
if (request.url().endsWith('.png')) {
await request.abort();
} else {
await request.continue();
}
} catch (error) {
console.error('Could not resolve intercepted request:', error);
}
});
The setRequestInterception API documents the behavior and basic pattern. In more complex setups, account for other interception handlers and cooperative interception behavior; handle promise failures so an interception action does not fail silently.
Recommended Free Tools
Best Value
Troubleshoot common Page event issues
- A popup or dialog is missed: the triggering action may happen before the listener is attached. Register the listener first, then perform the click or navigation.
- A 404 does not trigger
requestfailed: that is expected for a completed HTTP exchange. Listen forresponseor inspect the response status instead. - Navigation hangs after enabling interception: a request may not have been continued, answered, or aborted. Ensure every request path resolves it, including error paths.
- A listener keeps firing after its work is done: use
once()for a one-time event, or retain the callback and pass that same reference tooff(). - An event is unavailable or behaves differently: check the API reference matching your installed Puppeteer version, especially for events documented only on the
/nextpage or marked experimental.
Or skip the browser setup
If your goal is to obtain a page image or PDF rather than write browser-event automation, ScreenshotNeo provides a one-request screenshot API. See the ScreenshotNeo documentation for request options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
- Cookie banners are accepted and removed, along with supported newsletter popups and chat widgets, before capture.
- Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed; response headers identify the page verdict and billing outcome.
- An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for AI agents and MCP clients. - The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up free for 1,000 screenshots a month, with no card required.
Frequently Asked Questions
Does a 404 response trigger Puppeteer’s requestfailed event?
Usually not. A 404 is a completed HTTP response; inspect the response status rather than treating it as a transport-level request failure.
Which object does the popup event provide?
It provides a Puppeteer Page for the newly opened tab or window.
Can I use the PageEvent list unchanged across Puppeteer versions?
Check the API reference for your installed version. In particular, the cited PageEvent inventory is a next-version reference and marks issue as experimental.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




