https://secure.server.name/blockpagecontent
/How to block someone from
downloading your images or copy your contents from your webpage
By Disabling the 'right click option' people will be blocked down loading your images AND copying your text.
Disabling the 'right click option' stops people down loading your images AND copying your text.
OPTION 1:
The following piece of code added to the 'FOOTER CODE' under SETTINGS > SEO does the trick. It simply disables the right click option of the mouse.
<!--SEO Footer Code: To block someone from downloading your images-->
<body oncontextmenu="return false;">
If you want to display an alert message "Content on this site is subject to copyright.", use the code below:
<!--SEO Footer Code: To block someone from downloading your images and display alert message-->
<body oncontextmenu="alert('Content on this site is subject to copyright.'); return false;">
The following piece of code added to the 'FOOTER CODE' under SETTINGS > SEO does the trick. It simply disables the right click option of the mouse.
<!--SEO Footer Code: To block someone from downloading your images-->
<body oncontextmenu="return false;">
If you want to display an alert message "Content on this site is subject to copyright.", use the code below:
<!--SEO Footer Code: To block someone from downloading your images and display alert message-->
<body oncontextmenu="alert('Content on this site is subject to copyright.'); return false;">
Add the codes, save, publish and see how it works!!
/How to block someone from seeing your Source code
OPTION 2:
Adding some more code will block someone from seeing your source code.
Naturally you can't see the source code by right clicking as the right click option has ordinarily been disabled BUT you can still access it using key board short cuts.
The code below is added to the 'HEADER CODE' under SETTINGS > SEO.
<!--SEO Header Code: To block someone from seeing your Source code-->
<script type="text/javascript">
document.onkeydown = function (cc) {
if(cc.which == 85){
return false;
}
if(cc.which == 80){
return false;
}
}
</script>
--------------------------------------------------------------------------------
OR use the code below to prevent right click on "images" only:
--------------------------------------------------------------------------------
OPTION 3:
<!-- Following code will prevent right click on images place is just above closing </body> tag -->
<script>
document.oncontextmenu = function(e){
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
return false
}
</script>
<!-- code to prevent right click ends here -->
Adding some more code will block someone from seeing your source code.
Naturally you can't see the source code by right clicking as the right click option has ordinarily been disabled BUT you can still access it using key board short cuts.
The code below is added to the 'HEADER CODE' under SETTINGS > SEO.
<!--SEO Header Code: To block someone from seeing your Source code-->
<script type="text/javascript">
document.onkeydown = function (cc) {
if(cc.which == 85){
return false;
}
if(cc.which == 80){
return false;
}
}
</script>
--------------------------------------------------------------------------------
OR use the code below to prevent right click on "images" only:
--------------------------------------------------------------------------------
OPTION 3:
<!-- Following code will prevent right click on images place is just above closing </body> tag -->
<script>
document.oncontextmenu = function(e){
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
return false
}
</script>
<!-- code to prevent right click ends here -->
Here it is, inserted in to the either FOOTER "OR" HEADER code area as per instruction above accordingly.
These tips have been tried and tested on our platform.