如何在IOS设备中检测浏览器?

时间:2019-10-25 12:42:08

标签: javascript browser browser-detection

如何识别iOS设备中的Chrome,Safari,Mozilla Firefox浏览器?

const isSafariBrowser = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
const isFirefoxBrowser = navigator.userAgent.includes('Firefox');
const isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;```

0 个答案:

没有答案