Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

passive-events-support

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passive-events-support - npm Package Compare versions

Comparing version 1.0.16 to 1.0.17

2

dist/main.js

@@ -1,1 +0,1 @@

(()=>{"use strict";function e(e=!1){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(e){}if(e){const e=`[Passive Events Support] "passive" option is ${t?"":"not "}supported by your browser.`;t?console.info(e):console.warn(e)}return t}window.passiveSupported=e(),function(t=null,n=!1){const s=t||["scroll","wheel","touchstart","touchmove","touchenter","touchend","touchleave","mouseout","mouseleave","mouseup","mousedown","mousemove","mouseenter","mousewheel","mouseover"],o=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(...t){const i=t[2];if(s.includes(t[0])&&(!t[2]||void 0===t[2].passive)){const s=t[1].toString(),[o,...u]=s.split("{"),r=o.replace(/(function|=>)/,"").trim(),c=u.join("{"),l=(r.match(/\(([^)]+)\)/)||[`(${r})`])[0].replace(/[()]/g,""),d=!(!l||!(c.includes("preventDefault")||c.includes(`(${l})`)||c.includes(`(${l},`)||c.includes(`,${l})`)||c.includes(`, ${l})`)||c.includes(`,${l},`)||c.includes(`, ${l},`)));t[2]={...t[2]||{},...e()&&{passive:!d}},n&&console.info("[Passive Events Support] Updated Event Listeners",{element:this,event:t[0],handler:{fnArgument:l,fnContent:c,fnPrevented:d},oldArguments:i,updatedArguments:t[2]})}o.call(this,...t)}}(window.passiveEvents)})();
(()=>{"use strict";function e(e=!1){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(e){}if(e){const e=`[Passive Events Support] "passive" option is ${t?"":"not "}supported by your browser.`;t?console.info(e):console.warn(e)}return t}window.passiveSupported=e(),function(t=null,n=!1){const s=t||["scroll","wheel","touchstart","touchmove","touchenter","touchend","touchleave","mouseout","mouseleave","mouseup","mousedown","mousemove","mouseenter","mousewheel","mouseover"],o=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(...t){const i=t[2];if(s.includes(t[0])&&(!t[2]||void 0===t[2].passive)){const s=t[1].toString(),[o,...u]=s.split("{"),r=o.replace(/(function|=>)/,"").trim(),c=u.join("{"),l=(r.match(/\(([^)]+)\)/)||[`(${r})`])[0].replace(/[()]/g,""),d=!(!l||!(c.includes("preventDefault")||c.includes(`(${l})`)||c.includes(`(${l},`)||c.includes(`,${l})`)||c.includes(`, ${l})`)||c.includes(`,${l},`)||c.includes(`, ${l},`)));t[2]={...t[2]||{},...e()&&{passive:!d}},n&&console.info("[Passive Events Support] Updated Event Listeners",{element:this,event:t[0],handler:{fn:t[1],fnArgument:l,fnContent:c,fnPrevented:d},oldArguments:i,updatedArguments:t[2]})}o.call(this,...t)}}(window.passiveEvents)})();
{
"name": "passive-events-support",
"version": "1.0.16",
"version": "1.0.17",
"description": "Passive Events Support",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -74,3 +74,8 @@ export function passiveSupported(debug = false) {

event: args[0],
handler: { fnArgument, fnContent, fnPrevented },
handler: {
fn: args[1],
fnArgument,
fnContent,
fnPrevented
},
oldArguments,

@@ -77,0 +82,0 @@ updatedArguments: args[2]

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc