I am looking for effective ways to prevent users from easily copying text from my website.
After doing some research, I came across a useful solution here
This method successfully prevents copy/paste/cut actions when using ctrl key combinations and the right-click menu.
However, during testing, I discovered that I could still drag the content from my TextArea into applications like Word and Visual Studio 2012 using Firefox, Chrome, and Safari. At this point, I stopped further testing.
The code snippet below shows my implementation based on the referenced post:
<textarea readonly="readonly" draggable="false" >
blah blah
</textarea>
I have also attempted another approach using the following script:
<script>
$(document).delegate('input[type=text],textarea',
'copy paste cut drag drop',
function (e) {
e.preventDefault();
});
</script>
Additionally, I tried using the @Html.TextArea method with specific event handlers to prevent copying:
@Html.TextArea("Blah", "blah"
,new { oncopy= "return false", onpaste="return false", oncut="return false"})
Despite these efforts, the drag and drop copying method remained unaffected. Is there a foolproof way to ensure that text data cannot be taken off the site?
EDIT*** While not foolproof, I am open to suggestions on making it more difficult for average users to copy text, as the drag and drop method is quite straightforward.