Created
August 3, 2014 11:45
-
-
Save Ventero/b022e931ef9a90d05c51 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name script1 | |
// @include * | |
// @grant unsafeWindow | |
// ==/UserScript== | |
unsafeWindow.MouseFunction = exportFunction(function (event) { | |
console.log(1); | |
}, unsafeWindow); | |
unsafeWindow.addEventListener("mousedown", unsafeWindow.MouseFunction, false); |
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
// ==UserScript== | |
// @name script2 | |
// @include * | |
// @grant unsafeWindow | |
// ==/UserScript== | |
setTimeout(function() { | |
console.log("removing event listener"); | |
unsafeWindow.removeEventListener("mousedown", unsafeWindow.MouseFunction, false); | |
}, 5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment