Let's Start To Disable Select or Right Click From Being Copied Using Javascript Code

Is It Worth to Disable Select / Right Click And Clipboard Operations For Website? 

Protection of copyrighted materials is quite important and actual problem in the modern world. Most of authors (musicians, artists, writers and so on) make attempts to protect their creations. It is natural that authors of websites wish to protect their content as well. Their task is especially complex, because most of the Internet content is open for public access. 

What can the user do with the web page, which opened in the web browser? It can review it, print it or copy its content through the clipboard to some external editor for further processing. Webmaster, who wants to protect the content of its web page, attempts to prevent the user from printing or copying. What tools are available to the author of the website to achieve that goal? 

JavaScript is one of such tools, which available in all modern web browsers. It provides some limited possibilities to control interaction between the user and the web page. Let's review one of the most popular methods that webmasters use to protect their website content. It is based on JavaScript and it is easy to implement. Specific implementation is different for various web browsers, but idea is the same. Webmaster creates event handler that displays alert message (something like: "Right-mouse click or clipboard operations are not allowed!") and attaches it to the "document.onmousedown", "document.onkeypress", "document.onkeydown" and "document.oncontextmenu" events. So, the user see alert message, if it presses CTRL+A (select all), CTRL+C (copy), CTRL+X (cut) key combinations or presses right mouse button to activate context menu, which includes clipboard operations as well. 

------------------------------------------------------------------------
<script type="text/JavaScript">

function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
------------------------------------------------------------------------


Another approach is based on using "window.setInterval" function, which evaluates an expression each time a specified number of milliseconds has elapsed. Web page can clear clipboard each 20 milliseconds, while it is opened in the web browser. So the user cannot copy any content from the web page. 

It seems that both approaches solve the problem of protection from copying, but other side of the medal exists. Any user can disable JavaScript support in the web browser! That possibility reduces to zero all efforts of the webmasters, which use JavaScript to protect website content in such manner. The user can disable JavaScript and copy any content. Such "protection" may be even harmful for the website. The following may prevent the user from returning to the website in the future: 


Therefore such "protection" is absolutely worthless. It is no need to cut off usual functionality and annoy the user. The user may never back to such website. 


http://ezinearticles.com/?Is-It-Worth-to-Disable-Right-Click-And-Clipboard-Operations-For-Website?&id=612589 

0 Comments

Post a Comment