Welcome to the Droidnr123 blog there was a blogger friend who asked about how to disable Inspect Element on a blog?
What Is Inspack element in web?
In short, Inspect Element is one of the more useful features built into the desktop version of the browser that is capable of showing, editing, and even changing HTML code taken from site sources. Inspect Element is often used by blog designers to find out code such as CSS, HTML, javascript code on blogs.
Benefits Of Disabling Inspect Element on Blog?
If you don't want your theme code on Inspect Element to be known by others, you can prevent that from happening by installing a debugger script. That will make your blog more secure than copy and pasting certain code directly through Inspect Element.
How to Disable Inspect Element on Blog?
Here's How to Disable Inspect Element on Blogs, please follow these easy steps carefully.
( 1 ) Disable Inspect Element:
Open Blogger > Click the Theme menu > Click the Edit HTML button next to customize and add the following code just before the closing code body </body>or<!--</body>--></body>
<script type='text/javascript'>
//<![CDATA[
// Inspect
!function t(){try{!function t(n){1===(""+n/n).length&&0!==n||function(){}.constructor("debugger")(),t(++n)}(0)}catch(n){setTimeout(t,5e3)}}();
//]]>
</script>
Then click on Save theme Button and done.
( 2 ) Disable right-click:
For the results, you can check on your blog by opening the Inspect menu (right-click on the blog page).
Of course, this is not the most powerful way to protect your blog theme code. Many roads lead to Rome, so there are still many ways to find out the blog theme code, one of which is by disabling Javascript on your blog in the browser, as I have shared in this post Adding Adsense Adblocker Notifications on the blog.
To prevent this, my friend can add the code below.
Plese Add the following code before </head> or </head><!--<head/>-->
<noscript>
<style type='text/css'>
/* No Script */
body,html{overflow:hidden}
.noscript{background:#e74c3c;color:#fff;padding:8% 0 0 0;position:fixed;bottom:0;left:0;top:0;right:0;z-index:1000;height:auto;-webkit-transform:translateZ(0);transform:translateZ(0);overflow:hidden}
.noscript p{margin:0;text-align:center;padding:0 20px 10px 20px;margin:auto;font-size:3rem;line-height:1.5;font-family:monospace;max-width:1010px;text-transform:uppercase;font-weight:700}
.noscript p span{color:#ffe88b;font-size:10rem;line-height:normal;font-weight:normal}
</style>
</noscript>
Now add the following code just below <body> tag
<noscript>
<div class='noscript'>
<p><span>⚠</span></p>
<p>Please Enable Javascript to view our site content</p>
<p>Thank you</p>
</div>
</noscript>
Then Click the Save theme button to save changes.
( 3 ) Disable disable the CTRL + U function:
To be more protected, you can also install the Anti right-click code and disable the CTRL + U function on blogs like this right now.
Replace <body> with the code below
<body oncontextmenu='return false;' onkeydown='return false;' onmousedown='return false;' ondragstart='return false' onselectstart='return false' style='user-select:none;cursor:default'>
Or may it could be with the Javascript code below, add it before </body> or <!--</body>--></body>
<script type='text/javascript'>
//<![CDATA[
// Anti Klik Kanan
var message="Function Disabled!";function clickIE4(){if(2==event.button)return alert(message),!1}function clickNS4(e){if((document.layers||document.getElementById&&!document.all)&&(2==e.which||3==e.which))return alert(message),!1}document.layers?(document.captureEvents(Event.MOUSEDOWN),document.onmousedown=clickNS4):document.all&&!document.getElementById&&(document.onmousedown=clickIE4),document.oncontextmenu=new Function("alert(message);return false");
//]]>
</script>
After that Click the Save theme button.
Anyway, by installing the Anti right-click code and disabling the CTRL+U function on this blog Actually, I do not recommend it. Because I personally think that if I find a site that has this code installed, it will make me uncomfortable exploring every post in it, so subsequently I always close the site immediately. But if you think it's useful, please install it and readjust it according to your needs.
Okay, that's it for the post from Droidnur 123 on "How to Disable Inspect Element on Blogs". Hopefully, it's useful.