mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add Safari user-agent detection in Ace useragent lib.
This commit is contained in:
parent
335f8f78f0
commit
20732ed571
1 changed files with 7 additions and 0 deletions
|
@ -1350,6 +1350,11 @@ if (typeof navigator != "object")
|
|||
|
||||
var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
|
||||
var ua = navigator.userAgent;
|
||||
|
||||
var safariRegex = /version\/([\w\.]+).+?(mobile\s?safari|safari)/i;
|
||||
var safariResult = ua.match(safariRegex);
|
||||
var safariVersion = safariResult ? parseFloat(safariResult[1]) : 0;
|
||||
|
||||
exports.isWin = (os == "win");
|
||||
exports.isMac = (os == "mac");
|
||||
exports.isLinux = (os == "linux");
|
||||
|
@ -1366,6 +1371,8 @@ exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined;
|
|||
|
||||
exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined;
|
||||
|
||||
exports.isSafari = safariVersion || undefined;
|
||||
|
||||
exports.isAIR = ua.indexOf("AdobeAIR") >= 0;
|
||||
|
||||
exports.isIPad = ua.indexOf("iPad") >= 0;
|
||||
|
|
Loading…
Reference in a new issue