I was wondering if there are any javascript objects that are unique to all versions of Google Chrome.
I know there’s the window.chrome, but that was only implemented in Chrome 15, which was rather recent. I am wondering if there’s any objects (or multiple objects in conjunction) that are unique only to Google Chrome.
The reason why is I am building a web app that requires Chrome because it is “Chrome/Google”-themed/based. I don’t want users using Firefox or IE to look at a Google Chrome-looking app, and (because I do this myself sometimes), I don’t want to sniff the user agent because it can be spoofed.
Any help would be much appreciated!
The correct way to test for chome using feature detection is as follows:
The second part of the query is checking to see if you are webkit, as all webkit browsers have their CSS vendor properties start with Webkit (capital W).
The second part checks to see if you are safari and negates the second part. Safari is the only browser with a ‘Constructor’.