When there's an image on a website, it can be downloaded by the following ways:
- Right click on the picture and press
Save As
from the pop-up context menu - Right click on the webpage in Chrome, press
Inspect
, then find the directory where the image is stored by browsing thumbnails, then right-click on its filename there, and open in new tab, where it can be right-clicked alone to be Saved As
How can the active downloading of pictures be prevented altogether?
Regarding the two methods above, I have seen webpages that somehow:
- deny the right-click pop-up context menu (containing
Save As
) from appearing altogether, or - hide the images from the directory structure that
Chrome / Inspect / Sources
finds so that the visitor cannot save them with Inspect.
How do they suppress the image's right-click pop-up menu, or hide the image file from the Inspect
directories?
Edit
By download, I mean direct download where the visitor actively right clicks on the image and saves it to a specific directory on their computer.
By download, I do not mean:
- passive download (the image is automatically cached in some obscure temp folder by the browser just because of viewing the page)
- or screenshot (the image is copied to clipboard so that the visitor can edit and save it with Microsoft Paint).
Environment
Going by what's mostly used, let's assume visitors are predominantly using Google Chrome and we would like to disallow them from downloading images from our site. Obviously we would like to bar any browser from doing this, so we want a method that universally works.
From the host perspective, we'll assume for now Javascript is mostly used for tricks of this nature, but open to answers that achieve the same effect using other languages.