playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Docs]: Request::resourceType can return `images` on Firefox

Open phil294 opened this issue 1 year ago • 1 comments

Page(s)

https://playwright.dev/docs/api/class-request#request-resource-type

Description

The listing only mentions image, but on Firefox (only), HTML like

<picture><source><img src="http://localhost:5982/my/image/xyz.png"></picture>

results in the resourceType images instead.

phil294 avatar Oct 16 '24 16:10 phil294

Thank you for the issue, I can repro. We should make sure it's an image on Firefox.

page.on('request', request => {
  console.log(request.resourceType(), request.url());
});

await page.setContent(`<picture><source><img src="https://www.wikipedia.org/portal/wikipedia.org/assets/img/[email protected]"></source></picture>`);

dgozman avatar Oct 17 '24 12:10 dgozman