From: Alexander Ebert Date: Mon, 11 Feb 2013 23:04:03 +0000 (+0100) Subject: Added basic browser detection for Chrome X-Git-Tag: 2.0.0_Beta_1~490 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b8b58a7e3458461c0622acb3c04fd528caf286ae;p=GitHub%2FWoltLab%2FWCF.git Added basic browser detection for Chrome --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index dcf6581cd1..bff2bf2953 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -546,6 +546,33 @@ $.extend(WCF, { } }); +/** + * Browser related functions. + */ +WCF.Browser = { + /** + * determines if browser is chrome + * @var boolean + */ + _isChrome: null, + + /** + * Returns true, if browser is Chrome, Chromium or using GoogleFrame for Internet Explorer. + * + * @return boolean + */ + isChrome: function() { + if (this._isChrome === null) { + this._isChrome = false; + if (/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())) { + this._isChrome = true; + } + } + + return this._isChrome; + } +}; + /** * Dropdown API */