Last active
August 29, 2015 14:01
-
-
Save dannvix/085c9dd0f2626337ea07 to your computer and use it in GitHub Desktop.
Bookmarklet which enables select, context menu, and so on.
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
(function() { | |
function Revive (evnt) { | |
onEvent = "on" + evnt; | |
if(window.addEventListener) { | |
window.addEventListener(onEvent, function (e) { | |
for (var node = e.originalTarget; node; node = node.parentNode) { | |
[node] = null; | |
} | |
}, true); | |
window[onEvent] = null; | |
document[onEvent] = null; | |
if (document.body) { | |
document.body[onEvent] = null; | |
} | |
} | |
}; | |
var events = [ | |
"contextmenu", | |
"click", | |
"mousedown", | |
"mouseup", | |
"selectstart" | |
]; | |
for (e in events) { | |
Revive(e); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment