How do I disable the "Save Target As" item in right click menu in Internet Explorer and Firefox browsers?
4 Answers
You can't.
You can attempt to block the context menu entirely (which is annoying, and very very easy to bypass), but you can't do anything about individual options on it.

- 914,110
- 126
- 1,211
- 1,335
-
You can create your own custom context menu if you want. http://stackoverflow.com/a/20471268/3050426 – pravin Mar 20 '15 at 07:12
There is another option for that! You can prevent the user save your image by using the pointer-events css property:
img {
pointer-events: none;
}
Essentially what that's going to do is block any mouse events to img elements. You still going to get a dialog box but that is the same you get with background images.
https://developer.mozilla.org/pt-BR/docs/Web/CSS/pointer-events https://css-tricks.com/almanac/properties/p/pointer-events/

- 153
- 1
- 7
-
I love this. It doesn't interfere with accessibility software, it doesn't interfere with other browser functionality, and it won't piss your users off because they're used to not being able to copy or save-as on background images anyway. – Jay Irvine Dec 17 '21 at 22:26
-
Not possible. You could try blocking the context menu by adding the following to your body tag:
<body oncontextmenu="return false;">
This will block all access to the context menu (not just from the right mouse button but from the keyboard as well)

- 8,504
- 7
- 59
- 75