Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

how to disabling right-click - JavaScript code

Ads
banner
banner
banner
letsplay Offline referral

Posts: 274
Joined: Jul 2013
Reputation: 1

#1
Senior Member
I want to protect my website content from being copied! So I want to disable right click so that people won't be able to copy anything or see page source code.
maya Offline referral

Posts: 1,058
Joined: May 2013
Reputation: 34

#2
Posting Freak
Now if you want your website to be user-friendly I don't recommend that. I understand your concerns however if someone decides to copy your content they can just download a copy of your website then use notepad to see the code, or simply disable JavaScript on their web browser, also it is super annoying from the users point of view to have right click disabled!
Anyways to disable right click add this JavaScript before </head>

Code:
<script type="text/javascript">

function md(e)
{
  try { if (event.button==2||event.button==3) return false; }  
  catch (e) { if (e.which == 3) return false; }
}
document.oncontextmenu = function() { return false; }
document.ondragstart   = function() { return false; }
document.onmousedown   = md;

</script>
chod Offline referral

Posts: 860
Joined: Jul 2013
Reputation: 85

#3
Posting Freak
You can get around what you posted in FF by highlighting what you want text or image holding down the cntrl button then while holding it down go to Edit -> Copy .. Not sure if other browsers allow that ability as well. Been able to do that for many years on FF to defeat a "webmasters" attempt at disabling the right click. There are other tricks to getting around it as well.

If you are truly worried about content rippers, copyright your images and work. But it still wont prevent scrapers, or someone simply using wget or curl against the image or page they want since that is essentially all a scrapping tool is doing.
www.AdminEmpire.com
www.BlimptonTech.com - Best Free Online JavaScript tool to minify JavaScript files.
maya Offline referral

Posts: 1,058
Joined: May 2013
Reputation: 34

#4
Posting Freak
What I don't really like is when I visit a website that has no good content at all and you get those pop-up welcome messages, right click disabled and to make the already bad experience even worst I get the the pop-up message saying something like "Are you sure you want to leave this website" when I try get out of the website Smile
ndiey Offline referral

Posts: 5
Joined: Oct 2013
Reputation: 1

#5
Junior Member
what i see.
actually disable func' right click is no use, if you put code to disable right click they just need to press F12.
i already test it on my own website but ppl still can stole/copied my website.

beside now many software that they can use to stole/copied something from your website.
chod Offline referral

Posts: 860
Joined: Jul 2013
Reputation: 85

#6
Posting Freak
How to copy something that is right click disabled all depends on your browser and OS.
www.AdminEmpire.com
www.BlimptonTech.com - Best Free Online JavaScript tool to minify JavaScript files.
invisibe_dude Offline referral

Posts: 820
Joined: May 2013
Reputation: 24

#7
Posting Freak
@ndiey it's called website cloning but it only works with HTML sites not with PHP based!
chod Offline referral

Posts: 860
Joined: Jul 2013
Reputation: 85

#8
Posting Freak
(10-28-2013 10:30 PM)invisibe_dude Wrote:  @ndiey it's called website cloning but it only works with HTML sites not with PHP based!
You can scrape PHP based sites, you will just only get the HTML output. But there are still ways to get php files.
www.AdminEmpire.com
www.BlimptonTech.com - Best Free Online JavaScript tool to minify JavaScript files.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#9
Support Team
It pisses off big time when I vising a website and it has right click disabled or has those annoying JavaScript pop-ups like "are you sure you want to leave this page" hell yes I am sure!





User(s) browsing this thread: 1 Guest(s)