Thursday, August 19, 2010

Disable Copy Option for the Blog Posts

Follow these steps for disabling the copy option for the blog posts:

1. Goto Design -> Edit HTML
2. Make sure Expand Widget Templates check-box is not selected
3. Search for </head> tag
4. Copy the following Java script and Paste it before the </head> tag
<script language='javascript'>
var browserName=navigator.appName;
var is_chrome = navigator.userAgent.toLowerCase().indexOf(&#39;chrome&#39;) &gt; -1;
window.onload = function() {
 if (browserName==&quot;Microsoft Internet Explorer&quot;)
 {
  document.onselectstart = function() {return false;}
 }
 if (browserName==&quot;Netscape&quot;)
 {
  document.onmousedown = function () { return false; }
 }
 if(is_chrome)
 {
   document.onselectstart = function() {return false;}
   document.onmousedown = function () { return true; }
 }
}
</script>

5. Click on SAVE TEMPLATE

6. Click on View Blog to verify the changes made.


Enjoy Blogging... 

Note: Still there are some workarounds to copy the blog post contents. At least disabling direct copy, gives the intention of blogger to the visitors.

No comments:

Post a Comment