MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

HTMLCanvasElement.toDataURL() issue #258

Open Borisfrad opened 7 years ago

Borisfrad commented 7 years ago

Hi,

I'm trying to find a canvas element using querySelector and get the image data using toDataURL like this: document.querySelector('CSS_SELECTOR').toDataURL('image/png');

The problem is that I'm getting 'null' instead of actual image data. The canvas should be rendered using cornerstone.js but it seems to fail in that too.

Can anyone help solve this issue?

Thanks, Boris

hollingsworthd commented 7 years ago

When constructing, try new JBrowserDriver(Settings.builder().headScript("").build()) ... the toDataURL is actually being explicitly disabled to prevent browser fingerprinting like Tor Browser does. This is clearly unintuitive for people and should be more easily configurable with more obvious defaults. Thanks for reporting this!