Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,305 members, 7,808,037 topics. Date: Thursday, 25 April 2024 at 05:04 AM

How To Disable Right Click On Web Page Or Hide Page Source Code - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / How To Disable Right Click On Web Page Or Hide Page Source Code (1514 Views)

I Will Extract Phone Number And Email Of Any Facebook Page Or Group For You / If You Have 200 To 250k Facebook Page Or Group Come In / I Need Help On Making My Web Page Responsive (2) (3) (4)

(1) (Reply)

How To Disable Right Click On Web Page Or Hide Page Source Code by Opistorincos(m): 3:40pm On Jul 22, 2016
Hi guys, as stated in the article topic 'how to disable right click on Web page or hide page source code' is mainly aimed at fellow bloggers and Web developers. The main purpose of this little piece is to help you hide you blog's source code by disabling right click on all of your pages. This is to help prevent your original work i.e. blog's vital information from being 'lifted'/copied.

What is Page Source Code?

This is self explanatory to the gurus but for the sake of beginners, Page Source Code[PSC] is a file that contains the elements used in designing your web page, such elements includes html, css, pop, Javascript e.t.c. The source code of any website[the ones that doesn't have right click disabled] can be viewed by right clicking on the Web page of your choice & simply clicking the source code option[almost all pc browsers have this option], this makes your website design vulnerable to being duplicated as almost everyone who have access to a pc will be presented with codes you labored to come up with.

How To View The Source Code Of Any Blog/Website
As earlier stated, to view a blog's source code doesn't require much effort, all you have to do is visit any blog/web page of your choice, 'right click' on your mouse, select the "view page source" option. It's as easy as that.

How To Hide 'View Source Code' Option And Also Disable 'right click' Button On All Your Webpages
www.nairaland.com/attachments/4005920_img20160722145801_jpegb1e4f34158c627a313afa26e884c534e
I know you are already eager to know how to disable 'right click' and hide 'view page source' option. Simply follow the guidelines below keenly.
NB : Backup your blog's template before editing anything as I won't be liable for any defect in your blog's design.

This is for people on the platform

>> Login to your Blogger dashboard.
>> Navigate to template and click on the 'Edit html' option.
>> Copy the texts below[the ones with the yellow background].

<script language='JavaScript'>

<!-- Script To Disable Right Click By - http://www.eodob.com -->

var message = "function disabled";

function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; }

if (navigator.appVersion.indexOf("MSIE"wink != -1 && event.button == 2) { alert(message); return false; } }

document.onmousedown = rtclickcheck;

</script>

>> In the html editor, use ctrl F to find the head section.
[img]https://1.bp..com/-ri3WsM8Y_x4/V5InzHBH7GI/AAAAAAAAD7U/nTRiGAtKemIkksf9Cf0gNMG_0GZw5eQXwCEw/s1600/Screenshot_2016-07-22-14-54-05.png[/img]
>> Paste the code you had earlier copied just before the closing section of the head tag.
www.nairaland.com/attachments/4005922_screenshot20160722145536_jpeg2f14e60e9f7f99f5f6c84847e5bdb9ff
>> Save your template, visit your blog's homepage or any other page on your blog, try using the left click on your mouse in order to know if the infused script is now effective.


Web Developers

All you have to do as a Web developer in order to disable the right click button & hide your source code is to simply copy the script above, open the Cod of your web page's design, paste the code you had earlier copied anywhere within the head section of your design.

This is the end of the article & by now you must have disabled the right click function on your blog's webpage. If you encounter terms any problem with the tutorial, kindly inform the admin via the comment section.


http://www.eodob.com/2016/07/how-to-disable-right-click-on-web-page.html?m=1
Re: How To Disable Right Click On Web Page Or Hide Page Source Code by hollyfat(m): 7:52pm On Jul 22, 2016
The source code can still be view with Developer tools

1 Like

Re: How To Disable Right Click On Web Page Or Hide Page Source Code by Opistorincos(m): 8:40pm On Jul 22, 2016
hollyfat:
The source code can still be view with Developer tools

Only few people know this, thanks for your contribution though

(1) (Reply)

What Online Ads Do You Use? And Have They Worked For You? / For Parties Interested In Making Classic Commercial Video Ads / Bitcoin Trade Or Forex Trade. Which Is Better

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 16
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.