最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to Prevent Screenshot for Responsive website? - Stack Overflow

programmeradmin0浏览0评论

I am creating a website, and facing some problem -
I want to Prevent Screenshot in Website when it is tested on Mobile Phone.
I used jQuery for Desktop view It's working fine but how to prevent in mobile

Is it possible to prevent screenshot?

 function copyToClipboard() {
  var aux = document.createElement("input");
  aux.setAttribute("value", "print screen disabled!");      
  document.body.appendChild(aux);
  aux.select();
  document.execCommand("copy");
  // Remove it from the body
  document.body.removeChild(aux);
  alert("Print screen disabled!");
}

I am creating a website, and facing some problem -
I want to Prevent Screenshot in Website when it is tested on Mobile Phone.
I used jQuery for Desktop view It's working fine but how to prevent in mobile

Is it possible to prevent screenshot?

 function copyToClipboard() {
  var aux = document.createElement("input");
  aux.setAttribute("value", "print screen disabled!");      
  document.body.appendChild(aux);
  aux.select();
  document.execCommand("copy");
  // Remove it from the body
  document.body.removeChild(aux);
  alert("Print screen disabled!");
}
Share edited Mar 7, 2019 at 5:25 Anjali Patel asked Mar 6, 2019 at 12:44 Anjali PatelAnjali Patel 8253 gold badges11 silver badges24 bronze badges 5
  • 8 I can take another phone and take a picture of my screen. If you do not want people to copy something, don't put it on the web – mplungjan Commented Mar 6, 2019 at 12:45
  • Short answer, nope, you can't prevent it. – Dave Commented Mar 6, 2019 at 12:50
  • Any reason why you want to prevent screenshot? – Sudharshan Nair Commented Mar 6, 2019 at 12:56
  • Its a requirement from my client @SudharshanNair – Anjali Patel Commented Mar 6, 2019 at 12:58
  • 1 @AnjaliPatel. Actually verify with client why screenshot should be restricted. – Sudharshan Nair Commented Mar 6, 2019 at 12:59
Add a ment  | 

1 Answer 1

Reset to default 4

No, it is not possible to prevent screenshots from mobile.

发布评论

评论列表(0)

  1. 暂无评论