The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to disable CTRL + U and F12

3 posters

Go down

Solved How to disable CTRL + U and F12

Post by erchima 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
erchima
Forumember

Female Posts : 627
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 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
Ultron's Vision
Forumember

Male Posts : 631
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 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
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to disable CTRL + U and F12

Post by erchima 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
erchima
Forumember

Female Posts : 627
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 December 1st 2013, 6:13 pm

Is this solved?
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: How to disable CTRL + U and F12

Post by Ultron's Vision 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
Ultron's Vision
Forumember

Male Posts : 631
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 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
erchima
Forumember

Female Posts : 627
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 December 1st 2013, 6:26 pm

Topic solved and archived
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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