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)
Tracking
()
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; } } }
Comment 1•23 years ago
|
||
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.
Comment 2•23 years ago
|
||
Since this would reduce functionality for the user, propose WONTFIX or INVALID.
Reporter | ||
Comment 3•23 years ago
|
||
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
Comment 4•23 years ago
|
||
Gil: Even if you were able to disable right-click, the user could always goto View -> Page Source.
Reporter | ||
Comment 5•23 years ago
|
||
The HTML page will be displayed in a window without controls.
Comment 6•23 years ago
|
||
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
Reporter | ||
Comment 7•23 years ago
|
||
Boris - Thanks for the code snippet. Have a great Labor day weekend all!!! Gil Martinez Web Developer gil@bytefactory.org
Status: RESOLVED → CLOSED
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•