2d canvas GetImageData returning alpha value of 3 when 0 would be correct


I have an issue where using easeljs touch events perform really wrong and after debugging it seems that the issue boils down to the method how it detects if position has an element or not is by drawing an element with current transforms to 1x1 canvas and then reading that pixel and seeing if alpha is larger than 0. On other browsers this works and this worked on samsung internet few weeks ago.

With version it no longer works and I managed to narrow it down to getImageData returning an alpha channel value of 3 (instead of 0) when there were no pixels drawn to 2d canvas. Hotfixing the easeljs library to compare against 3 would bypass the issue, but this seems like it’s something that’s broken on the browsers side.

The issue can be replicated with basic demos CreateJS | A suite of JavaScript libraries and tools designed for working with HTML5

Thanks for help!

Looks like this happens due to security updates. Disabling tracker prevention removes issue but wouldn’t recommend it to users. Need to most likely then add hotfixes for affected legacy software and see if some had some hidden 1% alpha hitareas.

Hello. If possible, can you please provide a screen recording of the expected behaviour in a previous version of Samsung Internet and current behaviour in Samsung Internet v17.0.1.69?

Sorry, I havent got a device that I can repeat the issue with. Basically the hit areas on easeljs were off as everything that was marked as interactive would test their hits with canvas getImageData. And due to canvas fingerprinting security measures (turning them off removed the issue) everything was getting accepted touches.