Disable "save image" in iOS web application

Viewed 15470

I want to disable the "save image" menu in mobile web applications that appears when you hold down a finger on an image. I tried the CSS properties:

-webkit-user-select: none;
-webkit-touch-callout: none;

With "-webkit-user-select" the copy menu is disabled but not the one for saving images. "-webkit-touch-callout" seems not to be working (tried on iPad2).

I also tried this javascript:

$('img').live('touchstart,touchmove,touchend', function() {
  event.preventDefault();
});

But without any effect.

Any suggestions? Thanks in advance!

4 Answers

nothing worked for me except of removing the long press gesture recogniser:

for (UIView *subView in self.webView.scrollView.subviews) {
    for (UIGestureRecognizer *recogniser in subView.gestureRecognizers) {
        if ([recogniser isKindOfClass:UILongPressGestureRecognizer.class]) {
            [subView removeGestureRecognizer:recogniser];
        }
    }
}
Related