Socket
Socket
Sign inDemoInstall

idle-tracker

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    idle-tracker

Tiny pure Javascript library to track browser inactivity


Version published
Weekly downloads
8.1K
increased by11.05%
Maintainers
1
Install size
275 kB
Created
Weekly downloads
 

Readme

Source

Idle Tracker

idle tracker
npm gzip size downloads

Tiny Javascript library to track browser idle status. (callback when user is idle).

Demo

Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Samsung
Samsung
Opera
Opera
Edgelast versionlast 2 versionslast 2 versionslast 2 versionslast 2 versionslast 2 versions

Installation

via yarn

$ yarn add idle-tracker

or via npm

$ npm install idle-tracker

Usage

import IdleTracker from 'idle-tracker';

const idleTracker = new IdleTracker(options);

idleTracker.start(); // start tracker

idleTracker.end(); // stop tracker and release memory
Constructor options
Options NameTypeDefaultDescription
timeout (ms)number30000timeout to count as idle
onIdleCallbackFunctionnoopFunction to be called when idle status change, payload will be { idle: true/false }, with optional event payload
throttlenumber500throttle rate of callback

Future

  1. Browser might support this function natively in the future, see Idle Detection API
  2. Related newer API/Library: page-lifecycle, repo

Keywords

FAQs

Last updated on 11 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc