( type: string, fn: EventListenerOrEventListenerObject, target: Document | IWindow = document, )
| 17 | export { nowTimestamp } from '@rrweb/utils'; |
| 18 | |
| 19 | export function on( |
| 20 | type: string, |
| 21 | fn: EventListenerOrEventListenerObject, |
| 22 | target: Document | IWindow = document, |
| 23 | ): listenerHandler { |
| 24 | const options = { capture: true, passive: true }; |
| 25 | target.addEventListener(type, fn, options); |
| 26 | return () => target.removeEventListener(type, fn, options); |
| 27 | } |
| 28 | |
| 29 | // https://github.com/rrweb-io/rrweb/pull/407 |
| 30 | const DEPARTED_MIRROR_ACCESS_WARNING = |
no test coverage detected