Mc Tech Solutions

Detected Ad-Blocker

Please Turn off your adblocker to access Mc Tech Solutions.

Mc Tech Solutions
Join Us On Telegram To Get Latest Updates. Join now!

How to Disable Right Click, Copy, Select Text, View Source Code & dev tools in Blogger - Mc Tech Solutions

How to Disable Right Click, Copy, Select Text, View Source Code & dev tools in Blogger

Ensure your content on blogger by getting your blog site by debilitating all alternate routes and duplicate choices. So If you need to get your blog entries and pages from taking your contents and content then, at that point adhere to the guidelines given underneath. By incapacitating alternate route keys like handicap right-click, cripple duplicate, debilitate see source alternate way, and more from the program and use javascript as a substance assurance script for blogger or WordPress site you'll have the option to get all your blog entries on the double. 

Numerous bloggers and site engineers need to get their substance. By not permitting clients/guests of your site to do message determination, duplicate glue alternative, incapacitate right-click, cripple see source choice, and Developer Option easy route keys. Try not to stress Now, these are finished by setting a piece of JavaScript code. It is easy to adhering to the guidelines given underneath and executing all content in your site layout.

To get our site content and content we need to debilitate or impeding certain activities in the program, by incapacitating four of the most widely recognized activities, for example, 

Debilitating Text Selection and Copying, 

Handicapping the Right-Click menu, 

Handicap Viewing the Page Source Option (Shortcut key - Ctrl + U keypress in Chrome), and 

Handicapping the Chrome Developer Tools (Shortcut keys - F 12 or Ctrl + Shift + I keypress mixes). 

Why Disable right-click, see page source,text-choice and dev devices in Blogger site? 

Since there are bunches of content cheats on the web to duplicate or control or view secret code from your site. while the majority of the new bloggers don't prefer to compose content because of absence of information and different reasons. So they begin to take other's substance and numerous clients can check secret connections or contents that are stacked on sites like live streaming connections, significant mystery keys, and so forth 

For my situation, our Technical Arp site we as of now utilize a portion of this to forestall our novel substance, yet let me disclose to you the Most fixated part is Google makes no move to this. Indeed, even in some cases Google doles out a higher position to that copy content. Miserable Right! 

Along these lines, Disable the View page source choice, text choice, incapacitate right-snap, and any remaining ways. So how about we begin to carry out an All one Content Protection script for bloggers. 

NOTE: The accompanying aide gives you various codes that assistance with various activities like crippling the right-click or debilitate the view source choice in the blogger site or any site, so you could either pick what you need or get every one of them on your site format.

In Method 1

  1. Go to Blogger Dashboard
  2. Go to Theme/Template Section
  3. Click Edit HTML
  4. Now Find & Past Below SCRIPT Code before </body>

The following are JavaScript that helps to do our task.

JavaScript Code to Secure your Blog Post in Blogger or WordPress

The following are code blocks to disable Right Click, Text Selection, Copy function, Dev tools Shortcuts. So Copy and paste the below code blocks you want to use on your website.

How to Disable Right-Clicking

Use this code block to disable the right-clicking option.

CODE: 1 - without alert message 

<script type='text/javascript'> 
document.addEventListener('contextmenu', event => event.preventDefault());
</script>

CODE: 2 - with an alert message

<script type='text/javascript'> 
//<![CDATA[
var message="NoRightClicking is allowed in our website";
function arpianDisableClick() {
if (document.all) {
alert(message); //Remove this line if you don't want alert message
return false;
}
}
function arpianNoRightClick(e) {
if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {
alert(message); //Remove this line if you don't want alert message
return false;}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=arpianNoRightClick;
} else{
document.onmouseup=arpianNoRightClick;
document.oncontextmenu=arpianDisableClick;
}
document.oncontextmenu=new Function("return false")
//]]></script>

Use any one code block to disable right click on your website.

How to Disable Text Selection

For doing this we have numerous approaches to do that yet Use any of these code squares to debilitate text choice. At the point when choice itself can't occur, replicating will not be conceivable. Taking a stab at hitting Ctrl + C or Ctrl + V while perusing the blog and you'll see the distinction.

CODE: 1 - Using JavaScript


<script type='text/javascript'>
if (typeof document.onselectstart!='undefined' ) {
document.onselectstart=new Function (“return false” );
}
else {
document.onmousedown=new Function ('return false' );
document.onmouseup=new Function ('return true' );
}
</script>

CODE 2: Using jQuery


<script>
$('body').bind('copy cut drag drop', function (e) { e.preventDefault(); });
</script>

CODE 3: Using Pure CSS 

CODE 4: Advanced JavaScript 

Utilizing this we can straightforwardly target Clipboard and control text choice, assuming by one way or another the client can choose text, additionally we can choose what their clipboard will duplicate. Incredible Right! 

For additional about Text Selection and Copy Paste Visit: Disable Text Selection and Copy Function from Blogger

How to Disable Viewing Page Source (Ctrl + U)

Utilize this code block in your format to cripple the view source page alternate way choice, the console blend Ctrl + U, which is the console easy route to see page source. Albeit, this is an additional degree of safety, there are approaches to get around this which we'll see later in this aide.

CODE: With Alert message

// disable viewing page source
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
<script>
document.onkeydown = function(e) {
var message='Content is protected\nYou cannot view the page source.';
if (e.ctrlKey &&
(e.keyCode === 67 ||
e.keyCode === 86 ||
e.keyCode === 85 ||
e.keyCode === 117)) {
alert(message);
return false;
} else {
return true;
}
};
$(document).keypress('u',function(e) {
if(e.ctrlKey)
{
return false;
}
else
{
return true;
}
});
</script>

Remove the alert(message) line if you don't want the alert message to display.

How to Disable F12 Key – Dev Tools

Presently Finally, utilize this code block assuming you need to handicap the F12 key which allows the client to get to Dev Tools in the Chrome Web program. 

Not simply that, when you utilize this code block, it additionally cripples the Ctrl + Shift + I console the blend which is equivalent to squeezing the F12 key to open Dev Tools.


//disable F12 Key and Ctrl + shift + I combination
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js”></script>
<script>

$(document).keydown(function (event) {
var message = 'Content is protected\nYou cannot view the Dev Tools.';
if (event.keyCode == 123) { // Prevent F12
alert(message);
return false;
} else if (event.ctrlKey && event.shiftKey && event.keyCode == 73) { // Prevent Ctrl+Shift+I
alert(message);
return false;
}
});
</script>

Now time to put all in one block - All in One Content Protection JavaScript Code to secure website content.

Use the below code block to disable all actions mentioned in this post.


//disable right click menu
<script>

var message=”NoRightClicking is allowed in our website”;
function arpianDisableClick() {
if (document.all) {
alert(message); //Remove this line if you don’t want alert message
return false;
}
}
function arpianNoRightClick(e) {
if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {
alert(message); //Remove this line if you don’t want alert message
return false;}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=arpianNoRightClick;
} else{
document.onmouseup=arpianNoRightClick;
document.oncontextmenu=arpianDisableClick;
}
document.oncontextmenu=new Function(“return false”)

</script>

//disable Text Selection and Copying

<script type=’text/javascript’>
document.addEventListener(‘contextmenu’, event => event.preventDefault());
</script>

//==============================================================
// disable viewing page source
<script>
document.onkeydown = function(e) {
var message = “Content is protected\nYou cannot view the page source.”;
if (e.ctrlKey &&
(e.keyCode === 67 ||
e.keyCode === 86 ||
e.keyCode === 85 ||
e.keyCode === 117)) {
alert(message);
return false;
} else {
return true;
}
};
$(document).keypress(“u”,function(e) {
if(e.ctrlKey)
{
return false;
}
else
{
return true;
}
});

//=============================================================
//disable F12 Key and Ctrl + shift + I combination

$(document).keydown(function (event) {
var message = “Content is protected\nYou cannot view the Dev Tools.”;
if (event.keyCode == 123) { // Prevent F12
alert(message);
return false;
} else if (event.ctrlKey && event.shiftKey && event.keyCode == 73) { // Prevent Ctrl+Shift+I
alert(message);
return false;
}
});
</script>

NOTE: If you template is already using jquery library [ Mostly every template use it ] then remove  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> this jquery script as we must call it for one time.

Thanks for Visiting , Have A Nice Day



Post a Comment

Copyrights © Mc Tech Solutions. All Rights Reserved. Distributed by Mc Tech Solutions