File size: 752 Bytes
1923a66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Just for the sake of styling page
/* eslint-disable */

/**
 * Determine if this browser supports emoji.
 *
 * Modified from https://gist.github.com/mwunsch/4710561
 * and probobly originally github's javascript source
 */
function doesSupportEmoji() {
  let context;
  if (!document.createElement('canvas').getContext) return;
  context = document.createElement('canvas').getContext('2d');
  if ((typeof context.fillText) !== 'function') {
    return;
  }

  let 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;
}

if (!doesSupportEmoji()) {
  twemoji.parse(document.body);
}