Guide to protect websites with copy protection and Right Click

Tram Ho

Currently copying content from other Web sites to your Website without citing the source is a very common case in Vietnam. In this article will guide you in detail on how to prevent copy and right-click from combined users using CSS and JavaScript.

1. Block Copy

I will combine both methods of using CSS with JavaScript. You just need to put the following code before the closing </head> tag of your website’s HTML template to succeed:

Above is the anti-copy CSS3 paragraph; -webkit, -moz, -ms, -o are for compatibility with different browsers. Because it is CSS3, if any browser does not support it fully. It does not work, meaning the object can still be copied! That’s why we need JavaScript – this works well in most browsers.

However, JavaScript has the weakness that the object can actively turn off JavaScript of the browser to copy … And that’s why we should combine the two. Because CSS, the object can not turn off. Combining both makes them compensate for each other’s weak points

2. Prevent right-clicking

Add anti-right-click feature (limiting image and text copying), this is the code … The position is the same, you just leave it before the closing tag </head>.

Source: VNCoder: Direction to prevent copying and right clicking from users using CSS in combination with Javascript

Share the news now

Source : Viblo