Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Default Save Image Option In Mobile

When I hover hold on an image on mobile following options appears:

  1. Save Image
  2. Open Image
  3. Open Image in new tab.

How can I disable these options?

I googled and got the below code which is not working

.disableSave {
  -webkit-user-select:none;
  -webkit-touch-callout:none;
}
like image 314
Sheldon Cooper Avatar asked Sep 17 '25 22:09

Sheldon Cooper


2 Answers

Simple solution.

For iOS, use the following:

.disableSave {
    -webkit-user-select:none;
    -webkit-touch-callout:none;
}

For Android, use:

oncontextmenu="return false;";
like image 196
chicharito Avatar answered Sep 19 '25 10:09

chicharito


I used the following CSS and disabled image select + save in mobile and desktop browsers.

img {
  pointer-events: none;
}
like image 39
williamli Avatar answered Sep 19 '25 10:09

williamli