How to disable a browser's "Save Image As" right-click menu option

Hello Friends:

Is there a way to disable a browser’s Save Image As right-click menu option?

Thank you!

A quick google search got me this in javascript that can be put in the head html, however this only disables right-clicking entirely, not just the save image menu option.

<script type="text/javascript">
function click (e) {
  if (!e)
    e = window.event;
  if ((e.type && e.type == "contextmenu") || (e.button && e.button == 2) || (e.which && e.which == 3)) {
    if (window.opera)
      window.alert("");
    return false;
  }
}
if (document.layers)
  document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = click;
document.oncontextmenu = click;
</script>

It seems to work, ymmv.

This was just pasted this into Native Libraries:
image

1 Like

This is great because my App doesn’t itself require items in the Right-Click menu. It would be a bit rude for me to disable the menu, but I’m trying to prevent content “lifting” (even though web crawlers will lift anyway. Sigh!). Thank you also for including where to paste it (very helpful). Let me try this later tonight and post back on how it goes. Thank you!

This will not stop anyone that knows what they are doing from disabling the “disabling” code, though.

1 Like

Yes, that worked for me too (I just implemented it). :tada:

Yeah, this is true. I guess it’s to keep the principled people honest. :blush: