Created
April 13, 2015 00:18
-
-
Save zackdouglas/6b2cd45906c5519dd31a to your computer and use it in GitHub Desktop.
Attach and detach a window-wide event listener
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
javascript:void(function(){var f=function(e){console.log('%o:%o',this,e)},ael='addEventListener',n='click';window[ael](n,f);document[ael](n,f);window._zdf=f;}(window)) |
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
javascript:void(function(){var f=window._zdf,mel='removeEventListener',n='click';window[mel](n,f);document[mel](n,f);}(window)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment