April 6, 2012

How do you disable copy, paste, and print like Amazon's Kindle web e-reader?

Question by Dominic Tancredi

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.

Answer by Starx

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; }

}

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!