I want to block screenshot of this webpage by pressing window + prtsc. or screen shot black out like netflix. or screenshot should not be readable
Asked
Active
Viewed 1,327 times
1
-
What ever way you can think of achieving this, there is a way around it. – TheGeneral Jan 01 '21 at 06:39
-
there is a similar question on here might be helpful to you https://stackoverflow.com/questions/26296882/how-to-disable-printscreen-with-javascript/26297445 – Ruzaik Nazeer Jan 01 '21 at 06:50
-
2Thank goodness no-one has digital cameras or phones to take photos of the screen. – mjwills Jan 01 '21 at 08:07
2 Answers
1
You could try inserting the css code and see if it works for you:
@media print {
html, body {
display: none; /* hide whole page */
}
}
However, most streaming media services now make use of EME https://en.wikipedia.org/wiki/Encrypted_Media_Extensions. The media players built by these services make use of EME to invoke the underlying DRM (Digital Rights Management). Because of this Netflix can blackout the video player when you try to screenshot anything there.
WebBrowser -> HTML5/Javascript -> EME -> DRM
And yes, of course you can build your own solution using EME.

Ridwan
- 367
- 3
- 11
0
Try this code to Disable PrtScr
or Alt+PrntScr
in All Browsers using JavaScript.
<script>
function copyToClipboard() {
// Create a "hidden" input
var aux = document.createElement("input");
// Assign it the value of the specified element
aux.setAttribute("value", "You can no longer print.This is part of the new system security measure.");
// Append it to the body
document.body.appendChild(aux);
// Highlight its content
aux.select();
// Copy the highlighted text
document.execCommand("copy");
// Remove it from the body
document.body.removeChild(aux);
alert("Print screen diable.");
}
$(window).keyup(function (e) {
if (e.keyCode == 44) {
copyToClipboard();
}
});
</script>

Dhrumil shah
- 611
- 4
- 23