picmo icon indicating copy to clipboard operation
picmo copied to clipboard

Brave breaks emoji support detection

Open dEEpProjects opened this issue 2 years ago • 4 comments

On Brave (macOS Big Sur), the emoji picker shows emojis not supported by the platform.

brave issue

Please check the following fiddle on Brave on a system that doesn't support Emoji 14: https://jsfiddle.net/ugewta0r/

It seems caused by Brave's fingerprinting protections, which causes getImageData method returns inconsistent values. I see that you use this method on your codebase for emoji support detection.

When I disable the protection, all seems to work fine.

Below you can find some useful discussions: https://github.com/brave/brave-browser/issues/9591 https://github.com/koala-interactive/is-emoji-supported/issues/14

Maybe you could compare more than one pixel on your logic or allow slight color differences than the expected black.

Thanks for your great work!

dEEpProjects avatar Feb 08 '23 14:02 dEEpProjects

I tested this code https://jsfiddle.net/mjsL49up/4/ in Edge, Firefox, Chrome, and Opera on Windows 11, 10, 8.1, 8 e 7, in Safari, Firefox, Chrome, Opera e Edge on Mac OS Ventura, Monterey, Big Sur, Catalina, Mojave, High Sierra, Sierra, in Safari and Chrome on iPhone 14, 13, 12, and X and some Android versions.

It looks promising to me, sporadically it detects a lower version.

I've fixed some emoji codes, also.

fvasco avatar Feb 08 '23 15:02 fvasco

I tested the above code: Chrome 76 on Tizen TV detects Emoji 13 instead of 12.

fvasco avatar Feb 08 '23 16:02 fvasco

Supporting the Brave browser is not a priority for me right now. I will leave the issue open, PRs are welcome 😄

You can specify a specific Emoji version in the picker options, you can also run alternate detection code that works with Brave and pass the determined version to the picker

joeattardi avatar Feb 08 '23 17:02 joeattardi

I tested the above code: Chrome 76 on Tizen TV detects Emoji 13 instead of 12.

It is a Chrome 76 bug, fixed in a later version.

fvasco avatar Feb 09 '23 09:02 fvasco