The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Listen for Puppeteer page changes by attaching a callback to the Page object: use page.on('eventName', handler) for a persistent listener, page.once('eventName', handler) for a one-time listener, and page.off('eventName', handler) to remove a listener. Use lifecycle events for document milestones, framenavigated for URL changes in frames, popup for new tabs or windows, and request/response events to observe network activity.
Register and remove a Page event listener
Puppeteer’s Page is an EventEmitter. Register a callback with the event name and handler; you do not need to enable request interception just to observe ordinary traffic. The Page API reference for Puppeteer 25.12.0 documents these listener patterns. Check the API reference matching your installed version for event availability and payload details: Puppeteer Page API.
Persistent listener
function logRequest(request) {
console.log('A request was made:', request.url());
}
page.on('request', logRequest);
// Later, when the listener is no longer needed:
page.off('request', logRequest);
Keep the same function reference for page.off. Passing a newly written anonymous function will not remove the handler registered earlier.
One-time listener
page.once('load', () => console.log('Page loaded!'));
The callback runs for the next matching event and is then removed. Use page.on when the callback should continue to run on subsequent occurrences.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
Choose the event that matches the change
Page events describe different kinds of activity. The event catalogue lists names and payloads, but its surfaced reference is the next-version PageEvent reference; verify the matching release documentation before relying on a particular event.
| What you need to detect | Event or API | What the callback receives or tells you |
|---|---|---|
| Document load milestone | load |
Page lifecycle event |
| DOM content ready | domcontentloaded |
Page lifecycle event |
| Frame URL change or frame addition/removal | framenavigated, frameattached, framedetached |
A Frame object |
| Page opens a new tab or window | popup |
The popup’s Page |
| Page JavaScript logs or warns | console |
A ConsoleMessage |
| Uncaught page exception | pageerror |
Error data |
| Observe network traffic | request, response, requestfinished, requestfailed |
An HTTPRequest or HTTPResponse, depending on event |
| Control or block network traffic | setRequestInterception(true) with a request handler |
Requests that must be resolved safely |
Detect document and frame changes
Document lifecycle milestones
load and domcontentloaded are Page events for document lifecycle milestones. They are not interchangeable: choose the milestone that matches what your next step needs. For example, DOM content being ready does not itself establish that every resource or later page script has finished.
Frame navigation, including URL changes
Listen for framenavigated when you need to know that a frame navigated, then inspect the provided frame rather than assuming every event represents the main document:
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
page.on('framenavigated', frame => {
console.log('Frame navigated to:', frame.url());
});
This can report navigation in an iframe as well as the main frame. For frame creation or removal, use frameattached or framedetached where supported by your installed version.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsWait for navigation without racing it
If a click is expected to navigate, start waiting for the navigation and trigger the click together. Starting the wait only after the click can miss a fast navigation.
const [response] = await Promise.all([
page.waitForNavigation(),
page.click('a.next-page'),
]);
console.log('Navigated to:', page.url());
waitForNavigation() is a wait API, not an event listener. Likewise, networkidle0 and networkidle2 are navigation wait conditions, not Page event names. They refer to active connection limits held for at least 500 ms; choose lifecycle events or wait conditions according to the condition your task actually needs. See the Page interactions guide.
Rank #3
Listen for popups, console output, and page errors
New tabs and windows
The popup event is emitted on the page that opens the new tab or window. Its callback receives the new popup’s Page; the popup belongs to the parent’s browser context.
page.on('popup', popup => {
console.log('Popup opened at:', popup.url());
});
Browser-side diagnostics
Use console to inspect messages generated by page JavaScript and pageerror to observe uncaught exceptions:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchpage.on('console', message => {
console.log('Page console:', message.type(), message.text());
});
page.on('pageerror', error => {
console.error('Uncaught page error:', error);
});
A console event provides a ConsoleMessage, while a dialog event provides a dialog object that Puppeteer can accept or dismiss. Consult the version-matched API reference for the exact event payload types in your release.
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 network requests and responses
Puppeteer emits request and response events during ordinary page activity. A request passes through distinct stages: request fires when the page issues it, response when a response arrives, and requestfinished when the response body has been downloaded and the request completes. If the request fails, requestfailed replaces requestfinished.
page.on('request', request => {
console.log('Request:', request.url());
});
page.on('response', response => {
console.log('Response:', response.url(), response.status());
});
page.on('requestfinished', request => {
console.log('Finished:', request.url());
});
page.on('requestfailed', request => {
console.log('Failed:', request.url(), request.failure()?.errorText);
});
The official network logging guide covers these events and their sequence.
HTTP error status versus network failure
An HTTP 404 or 503 is still a response: it normally produces response and then requestfinished, not requestfailed. The latter indicates a network-level failure, not merely an unsuccessful HTTP status. Redirects finish one request and issue another request for the redirected URL.
Best Value
Use request interception only when changing traffic
Interception is for controlling requests, not a prerequisite for observing them. After page.setRequestInterception(true), requests stall until they are continued, answered with a response, aborted, or completed using the browser cache. An unresolved intercepted request can hold up page activity.
await page.setRequestInterception(true);
page.on('request', request => {
if (request.isInterceptResolutionHandled()) return;
if (request.url().endsWith('/blocked-resource.js')) {
request.abort();
} else {
request.continue();
}
});
When other listeners or integrations may also handle the request, check isInterceptResolutionHandled() immediately before resolving it. Keep the check and resolution together synchronously; if your handler performs asynchronous work first, another handler could resolve the request in the meantime. See the request interception guide.
Troubleshoot common Page event mistakes
- A listener never fires: confirm the event name and payload against the documentation for your installed Puppeteer version. For navigation-triggered events, register the wait before or alongside the action that causes navigation.
page.offdoes not remove the listener: pass the exact same callback function reference used withpage.on.- A 404 does not trigger
requestfailed: that is expected; inspect the HTTP response status because an HTTP error is still a completed response. - Intercepted requests hang: ensure every request is continued, responded to, or aborted, and guard against a request another handler has already resolved.
networkidle0is not firing as an event: use it as a navigation wait condition, not as an argument topage.on.- A navigation event seems unrelated to the main page: inspect the event’s
Frame; frame navigation events can involve an iframe.
Or skip the browser setup
If your goal is simply to capture a website rather than build a Puppeteer event workflow, ScreenshotNeo is a website screenshot API and MCP server. Its one-call GET request returns a PNG, JPEG, WebP, or PDF. See the ScreenshotNeo API docs for options.
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, and failed loads are not billed, and responses identify page verdict and billing status in headers. Its MCP server lets AI agents use screenshot tools, and the free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month, with no card required.
Recommended Free Tools
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.

