Closed Bug 97600 Opened 23 years ago Closed 23 years ago

Unable to disable the right click in NS6.1

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

CLOSED DUPLICATE of bug 72084

People

(Reporter: gil.martinez, Assigned: joki)

Details

I was able to disable the right click in NS6.0, however with the release of 6.1 
I am not able to disable the default "onright-click" menu from displaying. Here 
is the code i am using. 

// No Right Click
 if (Browser == 'NS6') {
 	document.addEventListener("mouseup", click, true);
 } else if(Browser == 'NS4' || Browser == 'IE'){
	document.onmousedown=click;
 }

function click(e) {
	//	Alert message
	var message = "Sorry, right click is not allowed!"; 
	// Check for NS6, NS4, IE Right Click Disabled
	if( ((Browser == 'NS6' || Browser == 'NS4') && (e.which == 3)) || 
((Browser == 'IE') && (event.button == 2)) ){			
		alert(message);
		if(Browser == 'NS6'){
			//e.stopPropagation
			//e.preventBubble();
			//e.preventDefault();
			e.cancelBubble();
		} else {
			return false;
		}
	}
}
Please tell me this will never be fixed, that's one of the top annoying feature
of IE, i don't want to see this in Mozilla.
Since this would reduce functionality for the user, propose WONTFIX or INVALID.
I am all for the user being able to view the source - being a developer and 
all. However, the application I am developing requires that the user not be 
able to view the source. This is why i requested this fix. 

Regards,

Gil Martinez
Gil: Even if you were able to disable right-click, the user could always goto
View -> Page Source. 
The HTML page will be displayed in a window without controls.
And there is the Ctrl-u keybinding.....

In any case, this is a duplicate of "There is no way to disable the context menu
upon right-click (oncontextmenu?)" and you should be hooking into the
oncontextmenu event (works in Mozilla and IE5+, I believe).

*** This bug has been marked as a duplicate of 72084 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Boris - Thanks for the code snippet.

Have a great Labor day weekend all!!!

Gil Martinez
Web Developer
gil@bytefactory.org
Status: RESOLVED → CLOSED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.