question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebKit Canvas element invisible on screenshot

See original GitHub issue

When 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 chromium

Firefox firefox

WebKit webkit

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
lucas-jonescommented, Jan 23, 2020

MacOS

0reactions
pavelfeldmancommented, Jul 12, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found