On my old design of my website, I was able to disable the “Save Image” dialogue that happened if you pressed down for a moment on an image with this simple CSS styling
Code:
img {
-webkit-touch-callout: none;
}
The thing with the new design, the images are now links, so as to be able to go to a different page in reference to that link
I am able to do the jquery for desktop, but can’t seem to figure out how to do it for smartphones
Because you can use it to prevent the default action (to display the popup). It’s almost the same as the old code to prevent you from right-clicking on a web page.
Ultimately you can’t prevent users from downloading images - you can make it harder with the Javascript you just posted but if the user disables mobile JS (I know I can) then ultimately the images will be downloaded.
It’s on the web - people can access it. No concrete way of stopping users c ompletely.
On mobiles you can take a screen shot, which is much the same as downloading the image. Same on desktop too, for that matter. If you don’t want people to take the image, don’t show it to them.
I think most of these questions aim to “fix” the problem for the bulk of the end-users visiting the site. I don’t think there’s any amount of JavaScript that can prevent us developers from tinkering
At the end of the day, Javascript can be disabled and rendered useless. So he shouldn’t move forward with the ideaology that he can protect his images. That’s why you see (for example) sites that sell marathon photos they took mid-race…they have watermarks to make the image less appealing (who wants a watermarked down image of themselves crossing the finish line? It just looks bad)
If he can protect 90% of downloads then it’s better to do something rather than nothing. Perhaps he’s not learnt about watermarking yet. Maybe the server doesn’t have suitable image processing.
I am providing an answer to the original question, but I respect your right to comment on alternative methods.