LocalStorageTabCounter

Viki. LocalStorageTabCounter

Keeps track of how many tabs a user has open at one time using LocalStorage to store count

Constructor

new LocalStorageTabCounter(lsKey)

Source:
Parameters:
Name Type Description
lsKey String Key for localStorage entry. Defaults to `tabCounter`

Extends

  • TabCounter

Methods

getCount() → {number|null}

Source:
Returns:
- Number of tabs open in session or null if localStorage is not working in current browser
Type
number | null

isLocalStorageEnabled() → {boolean}

Source:
Returns:
- Status for localStorage usage. This is inspired by lscache https://github.com/pamelafox/lscache/blob/master/lscache.js#L54
Type
boolean