WKWebView screenshot produces a black screen.

Hello,
Not sure if I'll get the answer here, but I'll try anyway.
So, I'm trying to capture a screenshot of WKWebView content, and all works fine.

However, I've noticed that some pages have <canvas> tag which is used to render some interactive content. Like some playable ads or so.

In that case, my screenshots didn't capture that content. All other HTML elements are on the screenshot. Also, the same issue with the video content.

I've tried different methods, even using OpenGL for grabbing the screen buffer pixels. No luck.

Is there any way to capture the screenshot somehow? Or grab the pixels directly from GPU?


Thanks in advance.

Replies

Hi I am facing a similar issue, where you able to find a solution for this?