1

How does Amazon Kindle's web e-reader (https://read.amazon.com/) disable copy and paste?

Also, how does it make the "printing" of the page render only a blank page?

I reviewed it in the Google Chrome browser, and would like to know what browsers this can be implemented on.

They still allow text selection (for Highlight or Note) so they're not disabling selection, I believe.

khollenbeck
  • 16,028
  • 18
  • 66
  • 101
Dominic Tancredi
  • 41,134
  • 7
  • 34
  • 50
  • possible duplicate of [Disabling Copy/Paste in a Web Page](http://stackoverflow.com/questions/3020715/disabling-copy-paste-in-a-web-page) – mrtsherman Apr 06 '12 at 05:25
  • The question (and answers) aren't specific enough for it to be a duplicate. I'm asking how to select, and highlight text (as in Kindle's e-reader), but disable copy (and thus subsequent paste). Same with print. Thanks for linking out. – Dominic Tancredi Apr 07 '12 at 06:20

1 Answers1

1

Mostly they are done by JavaScript. They catch the key stroke of ctrl + c & ctrl + v then cancel the propagation. And also they disable the right click, by catching the mouse event for right button and stop its propagation.

But this is of no use because once the java script is disabled, they are all gone.

The printer printing blank can be done using media queries

@media print {

    * { display: none; }

}
Starx
  • 77,474
  • 47
  • 185
  • 261
  • Right-clicking doesn't bring up a menu to "copy-paste" apparently? – Dominic Tancredi Apr 06 '12 at 05:28
  • @ElliotBonneville, WRONG?? Are you kidding me? May be incomplete as I was middle of writing them down but Wrong, give me a break LOL – Starx Apr 06 '12 at 05:29
  • Your answer is not a solution. Apologies for using the wrong word to point this out. (or perhaps, 'not completing' what I meant to say, thinking you'd understand) – Elliot Bonneville Apr 06 '12 at 05:31
  • @ElliotBonneville, Now i will wait for your answer and see the solution. – Starx Apr 06 '12 at 05:33
  • I didn't post because I can't think of one, sorry. :( – Elliot Bonneville Apr 06 '12 at 05:34
  • It sounds like there's multiple strategies... disable the context menu, catch the key strokes for ctrl + c (which would make ctrl + v irrelevant? can't paste what you can't catch...) – Dominic Tancredi Apr 07 '12 at 06:21
  • 1
    How did this get a downvote? Sometimes people on SO drive me crazy! +1 anyways. @ElliotBonneville - how is his answer not a solution? He addressed all three of the guys questions. Key capture for mouse, disable right mouse button and css media for printing. Does he have to code the entire solution into a plugin, then drive over to his house and implement it? – mrtsherman Apr 07 '12 at 06:35
  • @mrtsherman: Hehe, this is misleading. Since I downvoted and commented on his answer, he's edited, perhaps more than once. I don't remember seeing the bit about disabling right click when I downvoted. – Elliot Bonneville Apr 07 '12 at 12:28
  • @ElliotBonneville, Just admit it you hate me :( – Starx Apr 07 '12 at 13:21
  • @Starx: Now why on earth would I hate you? You seem like a good guy. =) Some of your answers are a little less helpful imho, that's all. – Elliot Bonneville Apr 07 '12 at 14:37
  • @ElliotBonneville, I was just kidding :P – Starx Apr 07 '12 at 15:57
  • @mrtsherman +1 for suggesting he drive over to the house and implement... It's so rare for a coder to do house-calls... – Dominic Tancredi Apr 23 '12 at 14:32