WebKit Canvas element invisible on screenshot
See original GitHub issueWhen using page.screenshot
on Webkit, Canvas elements appear to be invisible.
When running headless: false
the canvas is visible in browser just not in screenshot.
It looks to be only on WebGL Canvas elements…
Chromium & Firefox work as intended.
Example
const pw = require('playwright');
(async () => {
const browser = await pw.webkit.launch(); // or 'chromium', 'firefox'
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('https://pixijs.io/examples/#/demos-basic/container.js');
await page.screenshot({ path: 'example.png' });
await browser.close();
})();
Chromium
Firefox
WebKit
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Screenshot of hidden div using html2canvas - Stack Overflow
You can set the visibility of your hidden element there. onclone: function(doc){ hiddenDiv = doc.getElementById('myDiv'); hiddenDiv.
Read more >Capturing an image from an HTML5 Canvas or Video Element
Taking a screenshot of an HTML5 Video element or HTML5 canvas element can add that extra flair to your web app. Here are...
Read more >Using HTML Canvas to Snip Screenshots of Your Video
First we add a button snip to control the conversion action. To show the cropped image, we add the image element croppedImg. Since...
Read more >Using images - Canvas API - MDN Web Docs
Get a reference to an HTMLImageElement object or to another canvas element as a source. It is also possible to use images by...
Read more >HTML <canvas> Accessibility - Paul J. Adam
Canvas elements SHOULD have a background fill · Good example: Screenshot of canvas element with background fill in High Contrast Mode · Bad...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
MacOS
I’ll close this as a part of the bug triaging process. We have hundreds of bugs and feature requests with dozens and even hundreds of upvotes, while this one only has a few thumbs up. Please feel free to open a new bug and link this one if you’d like to see it addressed.