debian-mirror-gitlab/app/assets/javascripts/emoji/support/index.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
708 B
JavaScript
Raw Normal View History

2017-09-10 17:25:29 +05:30
import isEmojiUnicodeSupported from './is_emoji_unicode_supported';
import getUnicodeSupportMap from './unicode_support_map';
// cache browser support map between calls
let browserUnicodeSupportMap;
export default function isEmojiUnicodeSupportedByBrowser(emojiUnicode, unicodeVersion) {
2021-01-03 14:25:43 +05:30
// Skipping the map creation for Bots + RSPec
if (
navigator.userAgent.indexOf('HeadlessChrome') > -1 ||
navigator.userAgent.indexOf('Lighthouse') > -1 ||
navigator.userAgent.indexOf('Speedindex') > -1
) {
return true;
}
2017-09-10 17:25:29 +05:30
browserUnicodeSupportMap = browserUnicodeSupportMap || getUnicodeSupportMap();
return isEmojiUnicodeSupported(browserUnicodeSupportMap, emojiUnicode, unicodeVersion);
}