Template:Team:KIT-Kyoto/browser

From 2014.igem.org

(Difference between revisions)
Line 1: Line 1:
<html>
<html>
<script type="text/javascript">
<script type="text/javascript">
-
    function kit_ua() {
+
/* * distinctUserAgent * JavaScriptの実装からUserAgentを判別 * Copyright (c) 2013 Kazz * http://asamuzak.jp * Dual licensed under MIT or GPL * http://asamuzak.jp/license */ (function(_win,_doc) { var UA = _win.opera ? 'Opera12' : !_doc.documentMode && _win.attachEvent ? 'IE7' : _doc.documentMode ? 'IE' + _doc.documentMode : !_win.matchMedia ? 'Safari4 / AndroidBrowser2' : !_win.ArrayBuffer ? 'AndroidBrowser3' : !_win.requestAnimationFrame && !_win.webkitRequestAnimationFrame ? 'Safari5 / AndroidBrowser4.3' : !_win.requestAnimationFrame ? 'Safari6' : !_win.CSS ? 'Safari7' : !_win.CSS.supports('(animation-timing-function: ease)') ? 'Chrome / Opera / AndroidBrowser4.4' : 'Firefox'; console.log(UA); /* 注:IE7はIE6以下を含む SafariにはiOS Safariを含む。また、Safari5には5.1も含み、6には6.1も含む AndroidBrowser2は~2.3まで AndroidBrowser4.3は4.0~4.3まで Opera12はPresto、Opera(番号なし)はBlinkのOpera Chrome等とFirefoxの判別は暫定的(将来Chromeがanimationのprefixを外したら判別できず) */ })(window,document);UA !== 'Firefox' && $('#kit_browser').text('Firefoxで見ろよ');
-
    var kit_ua = navigator.userAgent.toLowerCase();
+
-
    if (kit_ua.indexOf('chrome') != -1 || kit_ua.indexOf('safari') != -1 || kit_ua.indexOf('opera') != -1 || kit_ua.indexOf('msie') !=-1 || kit_ua.indexOf('trident') !=-1 ) {
+
-
    return true;
+
-
    }
+
-
    }
+
-
    if(kit_ua()) {
+
-
    $('#kit_browser').text('Your brouser is <strong>not</strong> FireFox. We recommend FireFox.');
+
-
    }
+
</script>
</script>

Revision as of 06:39, 11 September 2014