browerPatch.ts 469 B

123456789101112131415
  1. // @ts-ignore
  2. ;(function () {
  3. if (typeof EventTarget !== 'undefined') {
  4. const func = EventTarget.prototype.addEventListener
  5. EventTarget.prototype.addEventListener = function (type, fn, capture) {
  6. ;(this as any).func = func
  7. if (typeof capture !== 'boolean') {
  8. capture = capture || {}
  9. capture.passive = false
  10. }
  11. ;(this as any).func(type, fn, capture)
  12. }
  13. }
  14. })()