我想做的事:我想在除 Safari (Mobile/MacOS) 之外的每个浏览器中加载加载 Twemoji 。我尝试在 JS 中这样做,但没有奏效:
function IsSafari() {
var is_safari = navigator.vendor && navigator.vendor.indexOf('Apple') > -1 &&
navigator.userAgent &&
navigator.userAgent.indexOf('CriOS') == -1 &&
navigator.userAgent.indexOf('FxiOS') == -1;
return is_safari;
} if(!IsSafari){console.log("No reliable Emoji-set detected. Loading Twemoji from cdnjs");
$.getScript("https://cdnjs.cloudflare.com/ajax/libs/twemoji/12.0.4/2/twemoji.min.js", function() {
twemoji.parse(document.body);
});}