I need to hide HTML element on a page when someone press the key Printscreen so that the element not to be visible for capturing and not be copied to clipboard.
If I use the way like
document.addEventListener('keyup', (e) => {
let charCode = e.keyCode || e.which;
if(charCode == 44) {
document.querySelector('my-element').style.display = 'none';
}
});
the element is still visible at the printscreen event
Maybe there is a way how to defer the copying data to clipboard so that the element can be hidden before the copying via printscreen?