0

I always want something unusual, I hope the is duplicate, but I failed to find by myself. So read the question completely before marking as duplicate.

I know how to disable copy paste cut with object.('copy paste cut', function (e) { e.preventDefault(); });. But this doesn't work.

Do not throw eggs in me. It is really prevent from copy object itself. But not its parent, including every child, and of course including object.

This is not the end of the story. I'd like to be able to copy some children of object, but only one by one. In fact the object is table. I want to disallow to copy the complete table and allow to copy cells one-by-one.

PS. I know that this protection is like a law, the law didn't stop the person who to do something bad.

PPS. I know many ways to turn off protection. For example, I can switch off JS temporary, grab some data, or enter something I want to input or what ever. Most of the user do not know how to.

PPPS. I do not want to switch off copy-paste, off the selection, block some-key-press events for entire page or any thing else for an entire page. The task min to restrict for an average user the copy of entire table. The task max to allow copy a single cell. So this question is not a duplicate of the most of the such questions since I try to find out if it is possible to solve not the general copy-paste protection task, which I know how to do, but task with some special allow-deny restrictions.

loshad vtapkah
  • 429
  • 4
  • 11
  • This may depend on the browser, and many browsers give js limited control over some actions like copy paste cut, or implement it differently, so don't be surprised if there's no cross browser solution. – Goose Apr 15 '16 at 15:39
  • 7
    "I want to disallow". You can't do that. JS runs client-side, so clients have full control. It's them who usually allow you to run some code on their machines, but they can revoke you this privilege whenever they want. – Oriol Apr 15 '16 at 15:39
  • If your table shows on the user's screen, all the data already is on the user's PC. There is *literally nothing* you can do to prevent the user from copying your data. You can disable some mouse events, which is annoying as hell, but apart from that it does nothing to protect your data. – Tomalak Apr 15 '16 at 15:40
  • Some websites add some more text to the clipboard when you copy from them, to reference the source. For example: 'copied text copied text... copied form example.com' – rubentd Apr 15 '16 at 15:42
  • 3
    Possible duplicate of [How to Disable Copy Paste (Browser)](http://stackoverflow.com/questions/9958478/how-to-disable-copy-paste-browser) – Mike Cluck Apr 15 '16 at 15:44
  • 2
    @darthrubens And it is universally _reviled_ and there are many plugins to stop this from happening. In short, code downloaded to the client is _already_ copied and stored on the users computer, so it means all the data can be maintained no matter what you try. – somethinghere Apr 15 '16 at 15:46
  • @Oriol, I know that. I do not pretend for a complete solution, like a law is not a solution. It is not against professionals. – loshad vtapkah Apr 15 '16 at 15:52
  • @Tomalak, almost anything can be cracked, the question in level of a person the protection from, and the time and money that person need to spend. The customer know that this protection doesn't provide any guaranty, but for the potential end user this should be enough. – loshad vtapkah Apr 15 '16 at 15:59

0 Answers0