playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] WebGL 2 canvas are invisible in screenshots on Webkit (Official latest docker image)

Open robinDurstCS opened this issue 1 year ago • 2 comments

Context:

  • Playwright Version: 1.26.1
  • Operating System: Ubuntu (Playwright's docker image)
  • Node.js version: v16.17.1 (the one in the image)
  • Browser: Webkit

Code Snippet

Hello, hoping everyone is doing well 🙏 I've encountered an issue very similar to https://github.com/microsoft/playwright/issues/586 while working, created a little minimal reproduction repository here. I used that WebGL 2 sample for our minimal reproduction case.

The issue is that whenever I take a screenshot using page.screenshot(), the canvas drawn with WebGL 2 are not visible on it (WebGL 1 are). This only happens inside the docker image, on my laptop (MacOS), the canvas are visible.

Here is the same screenshot taken on Webkit (top) and Chromium (bottom) with (https://github.com/robinDurstCS/minimal-webgl2-screenshots/blob/main/index.js) on MacOS :

macos

And then the exact same code executed inside the official docker image (npm run start:docker, please see Dockerfile) :

image

From what I understood, we're using Webkit 16 here, maybe it doesn't support WebGL 2 ? What I know is latest Safari versions does.

Sorry If this is unclear, please feel free to ask for anything, I'll do my best to help, I remain at your disposal.

Cheers 🌞

robinDurstCS avatar Oct 07 '22 11:10 robinDurstCS

+1

lseguin1337 avatar Oct 07 '22 11:10 lseguin1337

Hello, I have the same problem. I automate tasks in a canvas with opencv, and I noticed with the screenshot that the content was not displayed. I tried with Firefox and Chromium and I had the same problem.

sanjuant avatar Dec 13 '22 22:12 sanjuant

Same here. It used to work in the playwright:v1.24.0-focal image.

Manduro avatar Jan 27 '23 10:01 Manduro

Note that WebGL 1.0 is now deprecated in ThreeJS, which is the most common way for developers to interact with WebGL.

prideout avatar Aug 08 '23 21:08 prideout