Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><sub><strong>This answer is very outdated</strong>, but it was very relevant back then in the stone age.</sub></p> <p>I think feature detect is more usefull than navigator.userAgent parsing, as I googled Opera ambiguosity <a href="http://www.javascriptkit.com/javatutors/navigator.shtml" rel="nofollow noreferrer" title="here">here</a>. Nobody can know if IE16 will parse the /MSIE 16.0;/ regexp - but we can be quite sure, there will be the document.all support. In real life, the features are usually synonyms for the browsers, like: <em>"No XMLHttpRequest? It is the f....d IE6!"</em> No nonIE browser supports document.all, but some browsers like Maxthon can scramble the userAgent. (Of course script can define document.all in Firefox for some reason, but it is easilly controllable.) Therefore I suggest this solution.</p> <p><strong>Edit</strong> <a href="http://www.javascriptkit.com/javatutors/objdetect3.shtml" rel="nofollow noreferrer" title="Here">Here</a> I found complete resources.</p> <p><strong>Edit 2</strong> I have tested that document.all is also supported by Opera!</p> <pre><code>var is = { ff: window.globalStorage, ie: document.all &amp;&amp; !window.opera, ie6: !window.XMLHttpRequest, ie7: document.all &amp;&amp; window.XMLHttpRequest &amp;&amp; !XDomainRequest &amp;&amp; !window.opera, ie8: document.documentMode==8, opera: Boolean(window.opera), chrome: Boolean(window.chrome), safari: window.getComputedStyle &amp;&amp; !window.globalStorage &amp;&amp; !window.opera } </code></pre> <p>Using is simple:</p> <pre><code>if(is.ie6) { ... } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload