Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

Anti-Disabler

restore context menus on sites that try to disable them






Jun 15, 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...

 
Apr 25, 2007
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;
}
}

 
Apr 11, 2007
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?

 
Sep 26, 2006
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.

 
Sep 26, 2006
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 -

 
Sep 15, 2006
Zoe Gillenwater User

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

 
Sep 3, 2006
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

 
Aug 9, 2006
Arvid Scriptwright

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

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

 
Aug 9, 2006
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);
}

 
Aug 9, 2006
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?

 
Jul 23, 2005
molgar User

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

You could comment on this script if you were logged in.