1.2.1 • Published 8 years ago

whoami.js v1.2.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

whoami.js

A simple and lightweight browser detection and logger library.

Codeship Status for andersonba/whoami.js

See demo page

Usage

// initialize whoami
var me = new whoami( [options] [, callback] );

// capture
me.execute();

The callback argument gets a data object with all catched informations.

Configuring whoami to communicate via API

// initialize whoami
var me = new whoami( urlApi [, options] [, callback] );

// capture
me.execute();

The callback argument gets 2 arguments:

  1. An error when applicable (usually from XHR request)
  2. A data object

See a server example using express.js

Options

nametypedefaultdescription
basicbooleantrueBasic browser informations (document title and url, user-agent, resolution, origin url and time)
consoleboolean|objectfalseCatch all console output. You could customize which method will be subscribed using options, eg.: {warn: true, log: false}
contextobject{}Set application context, like as userId, userEmail, etc
cookiebooleanfalseCatch all cookies from domain
errorbooleanfalseCatch all exceptions raised on the page
functionsobject{}Execute custom functions on capture and catch the return values. The functions could be sync/async using callback. You could create feedbacks prompts, check a ping using XHR request, etc
localStorageobjectfalseCatch all the localStorage data from domain
screenshotbooleanfalseCapture a screenshot using the html2canvas. It will returns a Data URI containing a representation of the image in jpg format
sessionStoragebooleanfalseCatch all the sessionStorage data from domain
shortcutbooleantrueBind the Ctrl+0 shortcut on keyboard to execute whoami.execute()

Thank You

With special thanks to BrowserStack for providing cross browser testing.

1.2.1

8 years ago

1.2.0

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago