tags:

views:

60

answers:

3

Has anyone seen a list of features unique to a given browser? For example, if you want to target just IE 8 acting like itself, you could do:

if (typeof document.documentMode != undefined) {
if (document.documentMode == 8) {
    ...stuff
}

}

Likewise, for all versions of IE you could check for window.clipboardData . But what about Firefox and webkit? I'm specifically trying to detect webkit at the moment, but I've been looking for a list like this for ages without luck.

+2  A: 

jQuery has/had pretty robust browser checking, but has migrated towards specific feature checking. Check them out for some hints.

Cide
+2  A: 

Quirksmode has always been great for this type of info.

Peter Bailey
+2  A: 

Your way of targeting browsers is flawed.

You check for the existence of a global variable to determine what browser you are in, but if any script which is included in your web page sets a documentMode global variable, your code will break. There are other ways to do browser detection (navigator.appName and navigator.appVersion for example), do a google search on the subject and you will find more detail.

SquareRootOf2