Playwright times out after any page.route usage

When I try to intercept any request using page, playwright just times out, even if nothing is changed:

import {chromium} from "playwright";

const b = await chromium.launch({
    headless: false
})

const p = await b.newPage();
await p.route('**/*', async (route) => {
    await route.continue();
});
await p.goto('https://www.google.com');

I would expect this code to just open google, but the loading spinner spins for a while, then timeout happens. Why?

Upvotes: 2

Views: 2784

Answers (2)

It is actually a bug introduced in latest Chrome version:

https://github.com/microsoft/playwright/issues/10376

I've managed to get my test setup working by disabling acceptCHFrame in node_modules/playwright.

Upvotes: 2

refactoreric
refactoreric

Reputation: 527

From the examples here, it looks like the route.continue() should not be awaited (and the handler is not an async function). Maybe that difference explains the timeout?

Upvotes: -1

Related Questions