Free tools Windows power users keep installed
One-click scans. No signup required.
You cannot get a Frame directly from Puppeteer’s documented ConsoleMessage API: it has no frame() method. You can compare message.location().url with the URLs of the page’s current frames to find possible matches, but treat them as candidates—not proof of which frame emitted the message.
What a Puppeteer console message exposes
A page’s console event gives you a ConsoleMessage. Its documented methods include args(), location(), stackTrace(), text() and type(); the class reference does not list a frame accessor. See the Puppeteer ConsoleMessage reference.
As an Amazon Associate I earn from qualifying purchases.
location() provides source-location information, while stackTrace() returns an array of location entries. Neither is documented as returning a Frame. The ConsoleMessageLocation interface and stackTrace() reference describe those location details.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Use the message URL to find candidate frames
For a quick diagnostic, compare the message’s location URL with the URLs in page.frames():
#1 Best Overall
page.on('console', message => {
const location = message.location();
const candidateFrames = page.frames().filter(
frame => frame.url() === location.url
);
console.log({
text: message.text(),
type: message.type(),
location,
candidateFrames,
});
});
This is a best-effort URL heuristic, not a guaranteed ConsoleMessage-to-Frame mapping. It can be ambiguous if multiple frames share a URL, and a frame may navigate between the event and the time you inspect the current frame tree. The documented APIs expose message location and frame URLs separately; they do not promise that these values establish frame identity. Refer to the ConsoleMessage API and Frame API.
Inspect the current frame hierarchy
When you need to see which frames currently exist, start with the page’s main frame and recursively visit its child frames. Puppeteer’s Frame reference documents mainFrame(), childFrames(), parentFrame(), url() and evaluate().
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
function dumpFrameTree(frame, indent = '') {
console.log(indent + frame.url());
for (const child of frame.childFrames()) {
dumpFrameTree(child, indent + ' ');
}
}
dumpFrameTree(page.mainFrame());
This lists the current hierarchy independently; it does not retroactively link a console message to a particular frame.
Recommended Free Tools
When frame attribution must be dependable
If your application controls the code that logs the message, include frame identity or other identifying context in the application-level log at the point where the message is produced. That avoids inferring identity later from a URL that may be shared or may have changed.
Rank #3
The reviewed public API references do not document a direct frame accessor on ConsoleMessage. If application-level logging is not possible and exact attribution is essential, investigate protocol-level facilities for the precise Puppeteer version you use; do not treat such an approach as a supported public ConsoleMessage feature based on these API references alone.
Common pitfalls
- Calling
message.frame(): the documentedConsoleMessageclass does not list this method. Use the message’s location and the page’s frame tree only as a candidate-matching heuristic. - Assuming one URL means one frame: multiple frames can have the same URL, so a URL match may return more than one candidate.
- Reading the frame tree later: navigation can change a frame’s URL after the console event. The current URL is not necessarily the URL at the time the message was emitted.
- Treating a stack entry as a frame:
stackTrace()returns location entries, not documentedFrameobjects.
Or skip the browser setup
For website screenshots, ScreenshotNeo offers a one-call API rather than requiring you to set up a browser capture flow. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; those cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the page verdict and billing status. Its MCP server gives AI agents tools for screenshots, page information and PDF capture.
For example, this cURL request saves a screenshot as WebP:
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
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month with no card.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Version note
Puppeteer’s API is version-sensitive. The Frame reference consulted identifies version 25.12.0; check the documentation matching your installed release before relying on API details across versions. The cited API pages do not state publication dates.
Quick Recap
Best Value
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.




