If your scraper runs on a single page app, you have probably written a fragile "did the page change?" check. Puppeteer 25.18 adds two events that make that check explicit, and it fixes several bugs around timeouts and aborted navigations that can leave long running automations stuck.
This post covers what changed in the Puppeteer 25.18.0 release, published on 2026-11-17, and what it means for your flows.
What is new in Puppeteer 25.18
The release adds a few features:
- Two page events,
framenavigatedsamedocumentandframenavigatednewdocument. - Network logs for workers.
- A
RemoteExceptiontype for both CDP and WebDriver BiDi errors. - A roll to Firefox 160.0 and to Chrome for Testing 157.0.8103.78, as listed on the supported browsers page.
The fixes matter just as much for unattended jobs. Navigation methods and waitForFunction() now honor an AbortSignal, including one that is already aborted. The CDP implementation also honors the signal option in goto() and releases its navigation listeners after a timeout or abort. The options you pass to launch() and connect() are no longer modified.
Same document vs new document navigations
Until now, framenavigated fired for every navigation, so you could not tell a full page load from a route change inside a SPA. The upstream issue asks for two events that distinguish new document and same document navigations.
According to the pull request, the same document event is emitted for Page.navigatedWithinDocument on CDP and browsingContext.fragmentNavigated on BiDi. The tests assert that framenavigated fires first, then only the specific event.
In practice:
- A full load, a redirect or a form submit is a new document. Your page state is gone.
- A
history.pushStateroute change or a hash change is a same document navigation. Your page state, listeners and injected scripts are still there.
That difference decides whether you need to re-inject a script, re-attach a listener or simply wait for new content.
How to use the new events in a code flow
Here is a small example. It re-injects a helper only when the document actually changed, and logs SPA route changes without reloading anything.
page.on('framenavigatednewdocument', async (frame) => {
if (frame !== page.mainFrame()) return;
await page.evaluate(() => {
window.__helperReady = true;
});
});
page.on('framenavigatedsamedocument', (frame) => {
if (frame !== page.mainFrame()) return;
console.log('SPA route change:', frame.url());
});
await page.goto('https://example.com/app', {
signal: AbortSignal.timeout(15000),
});
The signal option on goto() is useful on its own. With the 25.18 fixes, a timeout or an abort cleans up its navigation listeners instead of leaving them attached.
A few things to keep in mind:
- Filter on the main frame unless you really care about iframes.
- Do not drop
waitForSelector()orwaitForFunction()after a route change. The events tell you the URL changed, not that the new view has rendered. - Check the open issue about abort reasons in
waitForSelector()if you rely on custom abort errors. At the time of writing, custom error reasons are wrapped.
Running this in Puppetflow
Code flows in Puppetflow run JavaScript in a sandboxed Puppeteer environment, so the snippet above is the kind of logic you drop into a code step. If you prefer to stay visual, the nodal editor covers navigation, waiting and extraction without code, and you can mix both in one flow.
For recurring jobs, schedule the flow with a cron trigger or call it from a webhook. If a run needs a person, for example to solve a captcha, the human in the loop step pauses the flow instead of failing it. All of this is described in the Puppetflow documentation.
Before relying on a 25.18 feature, check which Puppeteer and Chrome versions your Puppetflow instance runs. A self-hosted setup lets you control that, while the cloud version follows the platform release.
Should you upgrade?
If your automations target SPAs, or if you have jobs that occasionally hang after a timeout, 25.18 is worth testing. Start with a staging flow, run it against your slowest target, and compare behavior on aborted navigations.
Want to try it? Open the Puppetflow docs, create a code flow and paste the snippet above.
