tags:

views:

23

answers:

1

I was about to write a script to dump out everything in navigator (excluding window) to help with debugging user issues (instead of asking the user what browser/operating system they're running, I'd like to point them to a page that dumps out everything interesting), and it occurred to me this has probably been done a million times before.

Do you know of a good cross browser, light script for dumping out all interesting user info? Bonus points if it has a clever way of getting the data to me (ie. avoids cut-paste-email).

+1  A: 

This is a great website, I always point people to this site when they need help:

http://www.supportdetails.com/

Plus, it has built-in system for sending emails. If you want to make your own but base it off of their code, most of the code for this is:

 // Screen Res
 if (self.screen)
 {
  S_RESOLUTION = screen.width + ' x ' + screen.height;
  S_COLOR_DEPTH = screen.colorDepth + ' bit';
 }
 else if (self.java)
 {
  var javaobj = java.awt.Toolkit.getDefaultToolkit();
  var screenobj = javaobj.getScreenSize();

  S_RESOLUTION = screenobj.width + ' x ' + screenobj.height;

  if (self.screen)
   S_COLOR_DEPTH = screen.colorDepth + ' bit'; ;
 }

 // Browser size
 var bsw = '';
 var bsh = '';

 if (window.innerWidth)
 {
  bsw = window.innerWidth;
  bsh = window.innerHeight;
 }
 else if (document.documentElement)
 {
  bsw = document.documentElement.clientWidth;
  bsh = document.documentElement.clientHeight;
 }
 else if (document.body)
 {
  bsw = document.body.clientWidth;
  bsh = document.body.clientHeight;
 }
 if (bsw != '' && bsh != '')
 {
  S_BROWSER_SIZE = bsw + ' x ' + bsh;
 }

 // Browser Type
 if (S_USE_CLIENT_FOR_BROWSER == "1")
 {
  var browser = $.browser.name + " " + $.browser.version;
  S_BROWSER_TYPE = browser;

  S_BROWSER_TYPE = S_BROWSER_TYPE.replace("msie", "Internet Explorer");

  if (S_BROWSER_TYPE.length > 0)
  {
   S_BROWSER_TYPE = S_BROWSER_TYPE.substring(0, 1).toUpperCase() + S_BROWSER_TYPE.substring(1, S_BROWSER_TYPE.length);
  }

  S_BROWSER_VERSION = "";
 }
Kranu
That's quite nice, thanks. I'd still like to see code as well so we can host it on our server and integrate it with our own pieces of user info.
Parand
You can just look at the source code of there site, and all the code is in there (it's not obsfucated). Most of it is here: http://www.supportdetails.com/includes/js/support-details.js?v12 (look under the getBrowserDetails function)
Kranu