Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable the 'save image' menu on iPhone with Javascript

Tags:

iphone

Have a photography site that I want to prevent image copying from. How can I disable the save image menu that pops up on an iPhone when you hold down your finger on an image?

like image 264
Matt Dietsche Avatar asked Sep 30 '10 14:09

Matt Dietsche


2 Answers

Try:

document.body.style.webkitTouchCallout='none';

As an aside is it really worth it? Hacks like this do impact user expectations, and your image is on the internet, anyone who wants it can easily get it regardless of whether a context menu has been disabled in the browser they're using.

like image 114
dannywartnaby Avatar answered Nov 02 '22 18:11

dannywartnaby


The solution with CSS (-webkit-touch-callout: none;) as @alex tells, works fine with iOS7 Safari. Thanks.

like image 29
jhernandis Avatar answered Nov 02 '22 20:11

jhernandis