The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to disable CTRL + U and F12

View previous topic View next topic Go down

Solved How to disable CTRL + U and F12

Post by erchima on December 1st 2013, 4:03 pm

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?

erchima
Forumember

Female Posts : 629
Reputation : 15
Language : INDONESIAN | Lua Script | Visual Basic | and Coding
Location : Under your bed xD

http://erchimacute.forumid.net

Back to top Go down

Solved Re: How to disable CTRL + U and F12

Post by Ultron's Vision on December 1st 2013, 4:57 pm

Rather than giving an overly elaborate answer, I'll give you the short answer.
It's not possible.

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Solved Re: How to disable CTRL + U and F12

Post by Ange Tuteur on December 1st 2013, 5:38 pm

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.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to disable CTRL + U and F12

Post by erchima on December 1st 2013, 6:03 pm

@Ultron's Vision wrote:Rather than giving an overly elaborate answer, I'll give you the short answer.
It's not possible.
lol xD
SethC1995 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.
well if so Very Happy

erchima
Forumember

Female Posts : 629
Reputation : 15
Language : INDONESIAN | Lua Script | Visual Basic | and Coding
Location : Under your bed xD

http://erchimacute.forumid.net

Back to top Go down

Solved Re: How to disable CTRL + U and F12

Post by Ange Tuteur on December 1st 2013, 6:13 pm

Is this solved?

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to disable CTRL + U and F12

Post by Ultron's Vision on December 1st 2013, 6:18 pm

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.

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.");
});
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.

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Solved Re: How to disable CTRL + U and F12

Post by erchima on December 1st 2013, 6:25 pm

SethC1995 wrote:Is this solved?
waiting hehe Very Happy  because i not use in forumotion but on blogger.com Very Happy 

@Ultron'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.

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.");
});
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.
thank you solved

erchima
Forumember

Female Posts : 629
Reputation : 15
Language : INDONESIAN | Lua Script | Visual Basic | and Coding
Location : Under your bed xD

http://erchimacute.forumid.net

Back to top Go down

Solved Re: How to disable CTRL + U and F12

Post by Ange Tuteur on December 1st 2013, 6:26 pm

Topic solved and archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum