-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (20 loc) · 705 Bytes
/
Copy pathindex.js
File metadata and controls
22 lines (20 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var emojiurlifier = function (emojiDomain, standardDomain) {
console.log('Emoji Domain Progressive Enhancement by https://i❤️.ws');
console.log('Learn more at https://github.com/jonroig/emojiurlifier');
var wl = window.location;
var useEmojiDomain = /^((?!chrome).)*safari/i.test(navigator.userAgent);
if (navigator.userAgent.indexOf('CriOS') > -1) {
useEmojiDomain = false;
}
var currentUrl = wl.protocol + '//' + wl.hostname;
var outputUrl = useEmojiDomain ? emojiDomain : standardDomain;
if (currentUrl === outputUrl) {
return;
}
if (wl.port) {
outputUrl += ':'+wl.port;
}
outputUrl += wl.pathname;
outputUrl += wl.search;
window.location = outputUrl;
}