getImageData does not work in Brave?

Description of the issue:

Brave doesn’t seem to support the HTML5 Canvas getImageData function (JavaScript). It is supposed to get the raw RGBA pixel data from an area within a Canvas, but it just returns empty data.

Steps to Reproduce:

  1. Save this file as example.htm: https://pastebin.com/raw/RfTEp7h9
  2. Open example.htm in Brave
  3. Look in Console: View > Developer > JavaScript Console, and then click the Console tab
  4. It should say: width = 20, height = 10, data = (an array with pixel data) like it does in other browsers, but they are zero and empty in Brave

Actual Result (gifs and screenshots are welcome!):

Expected result:


(this is from Firefox, it’s similar in Chrome)

Reproduces how often:

Always

Brave Version(about:brave):

Version 0.58.21 Chromium: 71.0.3578.98 (Official Build) (64-bit)

Reproducible on current live release (yes/no):

yes

Additional Information:

Thanks for reporting the issue.

I could not reproduce your issue with default shields settings on Brave 0.58.21.

Brave has optional feature called Fingerprint protection. It will block any methods that could potentially fingerprint your device. You probably enabled it.

Check your shields settings if you have Device recognition blocked:

Set it to 3rd-party device recognition blocked and it should work.

Let me know if that helped.

Thanks a lot, yes that did help, although I think I ran into a related issue.

When I try this from a remote location, e.g. I put my example code here:
https://jsfiddle.net/w1yqLrj0/

The bug still occurs if I put the setting to “3rd-party device recognition blocked”, but it does work if I change it to “All device recognition allowed” :+1:

However, when doing the same test with a local file, e.g. some example.htm on your harddrive, and opening that in Brave, the shield settings are disabled (shield icon is grayed out). Possibly because it thinks tracking does not apply to local files, but it prevents me from changing this setting. And thus, the canvas thing doesn’t work locally.

Shields only work on external hosted pages not on local html files. I can see the data populated with values when I save the html and load the page in the browser. Here’s a screenshot of it

I see, thanks. Any idea what could be causing it not to work here locally in my Brave? (latest version and I did not install any add-ons / extensions or make any configuration changes)

I reproduced the issue. The default shield settings are applied to all pages, even local pages.

Go to: brave://settings/?search=Fingerprinting+protection, and change Fingerprinting protection to Block 3rd party fingerprinting or Allow fingerprinting

Right, thanks, but that would also by default enable fingerprinting on online pages.

Is there perhaps a way to tell Brave to use NO fingerprint protection on local pages, but keep the default to block or block 3rd parties for online pages?

Or perhaps even easier, maybe it’s better not to disable the setting accessibility on local pages (i.e. don’t gray out the icon) so it can be changed there as well, just like any online page?

@btlechowski are you seeing shields working on Local files? Ideally it shouldn’t have any effect on any local file. The issue with localhost files hosted locally should be fixed in dev but not on release build. If you are seeing shields work on local file thats a bug. I dont see it on Linux so please log it if you see it happen on Windows 7

The global shields should not be applied to local files.

I have reported the issue.

Thanks!

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.