We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This little snippet seems to accurately detect if emoji is supported in a browser:
if (!String.fromCodePoint) { /*! * ES6 Unicode Shims 0.1 * (c) 2012 Steven Levithan <http://slevithan.com/> * MIT License **/ String.fromCodePoint = function fromCodePoint () { var chars = [], point, offset, units, i; for (i = 0; i < arguments.length; ++i) { point = arguments[i]; offset = point - 0x10000; units = point > 0xFFFF ? [0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF)] : [point]; chars.push(String.fromCharCode.apply(null, units)); } return chars.join(""); } } function doesSupportEmoji() { var context, smiley; if (!document.createElement('canvas').getContext) return; context = document.createElement('canvas').getContext('2d'); if (typeof context.fillText != 'function') return; smile = String.fromCodePoint(0x1F604); // :smile: String.fromCharCode(55357) + String.fromCharCode(56835) context.textBaseline = "top"; context.font = "32px Arial"; context.fillText(smile, 0, 0); return context.getImageData(16, 16, 1, 1).data[0] !== 0; }
Copied from this snippet.
The text was updated successfully, but these errors were encountered:
ec3d70b
No branches or pull requests
This little snippet seems to accurately detect if emoji is supported in a browser:
Copied from this snippet.
The text was updated successfully, but these errors were encountered: