Disable Ctrl+U [Page Source] of your website using JavaScript


I have as of late debilitated the "ctrl+u" highlight of my site and the main reason I did it since I have begun to notice that the greater part of my substance are getting duplicated. I never suspected that a few bloggers would even experience my page source and take my substance. 

Amazing! The principal thing I did on my online journal was handicap the substance determination and right snap and I suspected that is it, my website is protected. Be that as it may, later on, I came to realize that there's some more courses for taking substance and they are notwithstanding doing it. Along these lines, I made sense of an approach to impair seeing my page source utilizing alternate route keys [Ctrl+U] furthermore, there's one all the more approach to take substance, which is Ctrl+P (Print) and I crippled that one as well. To ensure your work, you should do these strides. Here's the means by which your can cripple Ctrl + U of your site- 



Note: If you disable Ctrl+U of your page, individuals will in any case have the capacity to see your page source on the off chance that you don't impair your right snap too. Click here to perceive how you can handicap right snap of your site. 

To cripple Ctrl+U, you simply need to put the beneath script over the end </head> tag.

<script type="text/javascript">
document.onkeydown = function (cc) {
if(cc.which == 85){
return false;
}
}
</script>

That’s all you need to do to disable viewing of your page source using shortcut keys. But to disable Ctrl+P along with Ctrl+U, use the below script instead.

<script type="text/javascript">
document.onkeydown = function (cc) {
if(cc.which == 85){
return false;
}
if(cc.which == 80){
return false;
}
}
</script>

The script actually disables just the ‘U’ and ‘P’ button which is all we need. Users will still be able to use other shortcut keys like ‘Ctrl C’ and ‘Ctrl A’. If you came here looking for some script to disable viewing page source because that’s how your contents are getting copied. Then you must disable other functions too, like content selection and all.

When you see that your contents are getting copied, don’t panic! Fight it. Here are the list of things you can do-

1. Disable content selection.
2. Disable right click.
3. Disable some specific keys like I have showed you on this one.

And the best thing you can do is file a complain to Google. Use this form to complain about the copied content. If the owner is using Google’s blogger, then they will surely take some serious action. If they find you right, then Google will either delete the content, or the entire blog or simply remove the copied content from the search results.


download script here.txt

Disable Ctrl+U [Page Source] of your website using JavaScript

0 Comments

Post a Comment