Created
May 29, 2024 01:38
-
-
Save AshKyd/35486c7b7fcf82d949e85452410e8848 to your computer and use it in GitHub Desktop.
Spy on video element methods and log when & where they're called from
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['pause', 'play'].forEach(method => { | |
const oldMethod = video[method]; | |
video[method] = function () { | |
console.log(`${method} (dom call)`, { video, e: new Error('here') }); | |
return oldMethod.apply(video); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment