Can Playwright be used to launch a browser instance

Question:

I’m finding that in some cases web pages are being rendered in one browser materially different than another browser. Specifically, Playwright running webkit is rendering a different structure than what I see when viewing the page in a standalone Chrome browser. No clue why and I can’t do anything about it. This isn’t a Playwright issue, it is rendering it the same way as a standalone browser would. Problem is I don’t know of an up-to-date webkit based browser for Windows.

Is there a way using just Playwright to open a browser window that will let me manually enter a url and inspect the page as Playwright renders it?

Asked By: FarNorth

||

Answers:

In playwright.config you have option

channnel: "chrome"

So with this you will start chrome, not chromium driver.

Answered By: Gaj Julije

You can use Playwright’s codegen tool and open the webkit browser

playwright codegen -b webkit
Answered By: hardkoded

You can also use the following command to launch a webkit browser with a desktop safari user agent:

npx playwright codegen -b webkit --device "Desktop Safari"
Answered By: Johannes