How to Disable Inspect or Dev Tools And View Page Source Code on Blogger
Hi Everyone, on this event I will share an instructional exercise on How to Disable Inspect Element in Blogger. Examine Element is one of the default elements of the work area variant of the program, having the option to follow the design of the code, see, alter, and supplant HTML code taken from blog or site sources.
Examine component is frequently utilized by blog fashioners to find the code like CSS, HTML, JavaScript code on the blog.
In the event that you would prefer not to examine component of your topic or blogger layout or don't need others to think about it. So you can keep this from occurring by introducing a debugger script that doesn't permit your blog to investigate some code straightforwardly. This will make the component protected from replicating.
Here's how to disable inspect elements on a blog using JavaScript, so please read the full post and follow the steps below.
How to Disable Inspect or Dev Tools Element on Blogger
<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>
Step 5 :-Then Save Theme
Now you can try viewing the results by right-clicking on the blog and selecting Inspect or with Ctrl + Shift + i or F12 .
Method 2<script type='text/javascript'>
//<![CDATA[
/* Inspect Element Disable JavaScript By www.mctechsolutions.in */
!function t(){try{!function t(n){1===(""+n/n).length&&0!==n||function(){}.constructor("debugger")(),t(++n)}(0)}catch(n){setTimeout(t,5e3)}}();
//]]>
</script>
Now you can try viewing the results by right-clicking on the blog and selecting Inspect or with Ctrl + Shift + i or F12 .
How To Disable View Page Source Code Element On Blogger <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'/>
<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>
Now you can try viewing the results by Clicking Ctrl + U.
