Browser test

test script for modern browser

by amitava82

HTML

<script src="http://www.featureblend.com/flash_detect_1-0-4/flash_detect.js"></script>
    <table>
        <thead>
            <tr>
                <th>Requirements</th>
                <th>Status</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Supported Browser: Internet Explorer 8, 9, Firefox 4+, Chrome 6+, Safari 5+ </td>
                <td><span class="bcBrowser">No</span></td>
            </tr>
            <tr>
                <td>Javascript Enable</td>
                <td><span class="bcJs">No</span></td>
            </tr>
            <tr>
                <td>Accept Cookie</td>
                <td><span class="bcCookie"></span></td>
            </tr>
            <tr>
                <td>Open Port: 5675</td>
                <td><span class="port1"></span></td>
            </tr>
            <tr>
                <td>Open Port: 5678</td>
                <td><span class="port2"></span></td>
            </tr>
            <tr>
                <td>Windows XP or above for Viewer</td>
                <td><span class="os"></span></td>
            </tr>
        </tbody>
    </table>

CSS

td,th {
    border: 1px solid #777;
    border-collapse: collapse;
    padding: 2px 3px 2px 3px;
}
th {
    background-color: #CCC;
}
table {
    padding: 0;
    margin: 0;
}

JavaScript

//Cookie test
            if (navigator.cookieEnabled) {
                $('.bcCookie').text('Yes');
            } else {
                $('.bcCookie').text('No');
            }
            //No script
            $('.bcJs').text('Yes');
            //modern browser
            if (isModernBrowser()) {
                $('.bcBrowser').text('Yes');
            }
            //Win OS
            if (IsWindows()) {
                $('.os').text('Yes');
            }

            //Browser test :: USer Agent
            function IsWindows() {
                return (window.navigator.platform.toLowerCase().indexOf("win") > -1 ? true : false);
            }

            function IsIE() {
                return (window.navigator.userAgent.indexOf("MSIE") > -1 ? true : false);
            }

            function IsSafari() {
                return (window.navigator.userAgent.indexOf("Safari") > -1 ? true : false);
            }

            function IsFirefox() {
                return (window.navigator.userAgent.indexOf("Firefox") > -1 ? true : false);
            }

            function IsChrome() {
                return (window.navigator.userAgent.indexOf("Chrome/") > -1 ? true : false);
            }

            function IsOpera() {
                return (window.navigator.userAgent.indexOf("Opera") > -1 ? true : false);
            }

            //Feature test function
            //IE8+
            function isDocumentMode() {
                return (document.documentMode) ? true : false;
            }
            //Firefox3.5+, IE8+ (in standards compliant mode only), Opera9.5+, and Safari 3+
            function isQuerySelector() {
                return (document.querySelector) ? true : false;
            }
            //Chrome 5, safari 5, FF3.5, IE9, opera 10.6
            function isGeoLoation() {
                return (navigator.geolocation) ? true : false;
            }

            function isModernBrowser() {
                if (IsIE() &&...