Closed Bug 282966 Opened 19 years ago Closed 19 years ago

The Advanced Javascript option to prevent the disabling of context menus is being bypassed by certain scripts.

Categories

(Firefox :: Settings UI, defect)

x86
Windows 2000
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 40535

People

(Reporter: basketcasesoftware, Assigned: bugs)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Here is the source of the script that disables context menus on this site. The
advanced java script options was set to prevent this from working, but it does
anyways. It actually just interrupts the display of the context menu until you
click the "ok" button, but it still is annoying.
<script language="JavaScript1.2">

/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

var clickmessage="Right click disabled on images!"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()

</script>

Reproducible: Always

Steps to Reproduce:
1. Go to site.
2. Right click on the page image
3. Nothing else needs to be done.

Actual Results:  
A pop-up alert window appears with an "ok" button that says "Right click on
images disabled" with an "ok". The context menu will not appear until the "ok"
is clicked. Given that I had pop-ups disabled as well, this is definitely a real
problem. 

Expected Results:  
Simply showed the normal context menu.

Suggested workaround: Disabling the running of ANY script in response to a right
click unless it originates on the local machine.

No additional information at this time.
Maybe not the right place for this, but at some point I would like to volunteer
my time for the project. I'm a former imbedded systems programmer/product
certification engineer for a tellecommunications product manufacturer with
research on data compression, mathematical computing and programming language
implementation. Let me know if I can help. :)
The site isn't disbling the menu, it's just popping up an alert before it
displays. It's a minor nuisance, the feature still works.

If you'd like to contribute to the project, a good place to start would be
http://www.mozilla.org/contribute/ or http://www.mozilla.org/hacking/ .

*** This bug has been marked as a duplicate of 40535 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
sorry for bugspam, long-overdue mass reassign of ancient QA contact bugs,
filter on "beltznerLovesGoats" to get rid of this mass change
QA Contact: mconnor → preferences
You need to log in before you can comment on or make changes to this bug.