A JS library for sniffing out information about pages, such as which JS libraries are used, what CMS the site runs on, what analytics packages it uses, and more. It is intended to be used in bookmarklets or injected JS widgets that need to gather information about the host page and it's component parts.
Where it can, Sniffer will return a string with more information (such as a version number) for each test; otherwise it will return boolean
Including (or for a more common use-case scenario, injecting) the sniffer.js file into a page will give you access to a single global variable,
Run an individual check by calling
Sniffer.check('test_item') where 'test_item' is a string representing the thing to test for - 'jQuery' or 'Wordpress', for example. See below for a list of currently implemented tests.
The result will be
undefined if Sniffer does not have a check corresponding to that name, boolean
false if the test was negative, boolean
true if the item was found but no other information could be extracted, or a text string of further information (normally the version number) if some can be extracted.
It's probably easiest to play around with the results of this in Firebug or Web Inspector to understand the exact structure of the JSON object returned. It's pretty straightforward ;-)
Sniffer.results() will return the same results object as
Sniffer.run(), populated only with information about checks that have already been run.