Skip to content

@jameswritescode /asshole.js forked from Kilian/annoying.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
How to be an asshole
//no context menu
document.oncontextmenu = function(){return false}
//no loading in iframes
if (parent.frames.length > 0) top.location.replace(document.location);
//no dragging
document.ondragstart = function(){return false}
//no text selection, in IE
document.onselectstart=function(){
if (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password") {
return false
} else {
return true;
}
};
//no text selection, in Firefox
document.onmousedown=function(e){
var obj=e.target;
if (obj.tagName.toUpperCase() == "INPUT" || obj.tagName.toUpperCase() == "TEXTAREA" || obj.tagName.toUpperCase() == "PASSWORD") {
return true;
} else {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.