Anti-Disabler

By Mark Pilgrim Last update Jun 19, 2005 — Installed 6,332 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 12 posts, 8 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Forrie User

This is a tricky script used everywhere from dynamicdrive. I've tried Anti-Disabler, then manually setting the clickIE4 and clickNS4 functions to null, but it doesn't work. From what I understand, I should be able to craft a simple script like this to null out those functions:


location.href="javascript:void(clickNS4=function(){})";
location.href="javascript:void(clickIE4=function(){})";

Anyone?

<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Please don't copy the photos, Ask the owner for your own copy!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// --> 

Thanks in advance...

 
shoe User

I replaced the contents of the script with:
var e, i, all;

if (document.attributes != null) {
document.onmouseup = null;
document.onmousedown = null;
document.oncontextmenu = null;
}

all = document.getElementsByTagName("*");
for (i = 0; i < all.length; i += 1) {
e = all[i];
if (e.attributes != null) {
e.attributes.onmouseup = null;
e.attributes.onmousedown = null;
e.attributes.oncontextmenu = null;
}
}

 
Aerik User

This is the only extension on which I get an error in the javascript console.

It points to line 52

document.onmousedown = null;

Why is that?

 
HATE User

oh sorry i forgot the link below by Arvid which works. sorry i formatted my pc and reinstalled everything so didnt notice Arvid's link.

 
HATE User

hey Arvid its not working again on IMDB pages.
http://www.imdb.com/rg/photos-name/summary//gal...
take a look there. please update this script one more time.

regards
- Al -

 
Zoe Gillenwater User

Thanks Arvid. Your update makes it work on imdb. Another annoyance thwarted!

 
HATE User

hey Arvid thanks for the update man. keep updating this script. without this it would be very hard to blog/stumble

so far it works on almost every no-right-click webpages

 
Arvid Scriptwright

Oh yeah, code in comments is not a good idea around here :/ Try this:

http://www.determinist.org/greasemonkey/antidis...

 
Arvid Scriptwright

Indeed, it does not work in imdb galleries. try this instead:

var e, i, all;

try {
document.onmouseup = null;
document.onmousedown = null;
document.oncontextmenu = null;
}
catch (err) {}

all = document.getElementsByTagName("*");
for (i = 0; i < all.length; i += 1) {
e = all[i];
e.setAttribute('onmouseup', null);
e.setAttribute('onmousedown', null);
e.setAttribute('oncontextmenu', null);
}

 
Zoe Gillenwater User

This script doesn't do anything to restore the right-click menus on the images in photo galleries on imdb.com. Any ideas?

 
molgar User

Messes up flickr interface, so you'll have to add http://www.flickr.com/* to the exclusion list.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel