How to disable CTRL + U and F12
3 posters
Page 1 of 1
How to disable CTRL + U and F12
How to disable CTRL + U and F12
so that other people can not steal the code from the forum xD
and how do I order if someone else pressed CTRL + U or F12, then they will be taken to the redirect link?
so that other people can not steal the code from the forum xD
and how do I order if someone else pressed CTRL + U or F12, then they will be taken to the redirect link?
Re: How to disable CTRL + U and F12
Rather than giving an overly elaborate answer, I'll give you the short answer.
It's not possible.
It's not possible.
Re: How to disable CTRL + U and F12
To add to Ultron's post,
While you can disable people from viewing your source, you can never really stop it completely. Simply put, I could disable the script you have running which prevents such, or prevent the page from creating further alerts.
I'd recommend against doing such as if you need support regarding the coding of your forum, I will most likely need to inspect your DOM to solve your issue. If you prevent us from viewing your source, It only makes it harder on us.
While you can disable people from viewing your source, you can never really stop it completely. Simply put, I could disable the script you have running which prevents such, or prevent the page from creating further alerts.
I'd recommend against doing such as if you need support regarding the coding of your forum, I will most likely need to inspect your DOM to solve your issue. If you prevent us from viewing your source, It only makes it harder on us.
Re: How to disable CTRL + U and F12
lol xDUltron's Vision wrote:Rather than giving an overly elaborate answer, I'll give you the short answer.
It's not possible.
well if soSethC1995 wrote:To add to Ultron's post,
While you can disable people from viewing your source, you can never really stop it completely. Simply put, I could disable the script you have running which prevents such, or prevent the page from creating further alerts.
I'd recommend against doing such as if you need support regarding the coding of your forum, I will most likely need to inspect your DOM to solve your issue. If you prevent us from viewing your source, It only makes it harder on us.
Re: How to disable CTRL + U and F12
Just to demonstrate a rather complex script that disables Ctrl+U and F12 as well as right clicks if the browser allows it.
Uses jQuery for simplicity. I don't want to implement all the error handling and compability issue fixes.
Uses jQuery for simplicity. I don't want to implement all the error handling and compability issue fixes.
- Code:
// attempt to prevent code from being seen if browser lets us do so
var disabledKeys = [123,"17,85"];
$(document).keydown(function(e){
if(e.keyCode==disabledKeys[0]||e.keyCode.toString()==disabledKeys[1]) {
alert("Code inspection has been disabled.");
return false;
}
});
$(document).mousedown(function(e){
alert("Right-clicking disabled. Code inspection not permitted.");
return false;
});
$(document).on("contextmenu",function(e){
alert("Context menu disabled. Code inspection not permitted.");
});
Re: How to disable CTRL + U and F12
waiting hehe because i not use in forumotion but on blogger.comSethC1995 wrote:Is this solved?
thank you solvedUltron's Vision wrote:Just to demonstrate a rather complex script that disables Ctrl+U and F12 as well as right clicks if the browser allows it.
Uses jQuery for simplicity. I don't want to implement all the error handling and compability issue fixes.Be aware that this is very, very, VERY frowned upon and will usually not contribute towards a good site's rating. Use at your own risk.
- Code:
// attempt to prevent code from being seen if browser lets us do so
var disabledKeys = [123,"17,85"];
$(document).keydown(function(e){
if(e.keyCode==disabledKeys[0]||e.keyCode.toString()==disabledKeys[1]) {
alert("Code inspection has been disabled.");
return false;
}
});
$(document).mousedown(function(e){
alert("Right-clicking disabled. Code inspection not permitted.");
return false;
});
$(document).on("contextmenu",function(e){
alert("Context menu disabled. Code inspection not permitted.");
});
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum