🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

detect-passive-events

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-passive-events

Detect if the browser supports passive events

2.0.3
latest
Version published
Weekly downloads
213K
-3.08%
Maintainers
1
Weekly downloads
 
Created

What is detect-passive-events?

The detect-passive-events npm package is a utility that helps developers determine if the browser supports passive event listeners. Passive event listeners can improve scrolling performance by letting the browser know that the event listener will not call preventDefault(), allowing the browser to optimize scrolling performance.

What are detect-passive-events's main functionalities?

Detect Passive Event Support

This feature allows you to check if the browser supports passive event listeners. The code sample demonstrates how to use the detect-passive-events package to log whether passive event listeners are supported.

const detectPassiveEvents = require('detect-passive-events');

if (detectPassiveEvents.hasSupport) {
  console.log('Passive event listeners are supported.');
} else {
  console.log('Passive event listeners are not supported.');
}

Other packages similar to detect-passive-events

FAQs

Package last updated on 12 Feb 2021

Did you know?

Socket

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