Important alert: (current site time 7/15/2013 1:24:33 PM EDT)
 

VB icon

Consequence Right-Click

Email
Submitted on: 6/13/2000 3:28:49 PM
By: Mike  
Level: Intermediate
User Rating: By 5 Users
Compatibility: JavaScript
Views: 12478
 
     This is a code that someone by the name of Jared Collums had submitted. I took it and changed it so when someone right clicks on your web site it says "Please don't steal my source code.(Click again and something bad may happen." And the second time they right click your page instead of an unremovable messagebox popping up it just shuts down there web browser or if they are on AOL it closes AOL.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: Consequence Right-Click
' Description:This is a code that someone by the name of Jared Collums had submitted. I took it and changed it so when someone right clicks on your web site it says "Please don't steal my source code.(Click again and something bad may happen." And the second time they right click your page instead of an unremovable messagebox popping up it just shuts down there web browser or if they are on AOL it closes AOL.
' By: Mike
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=1866&lngWId=14'for details.'**************************************

<SCRIPT LANGUAGE=JAVASCRIPT>
document.onmousedown=click
var times=0
var times2=10
function click() {
if ((event.button==2) || (event.button==3)) {
if (times>=1) { bye() }
alert("Please don't steal my source code.(Click again and something bad may happen."); 
times++ } }
function bye() {
now = new Date()
var hours = now.getHours()
var minutes = now.getMinutes()
var seconds = now.getSeconds()
var ap = "AM"
 if (hours > 12)
 {var ap = "PM" , hours = hours-12 ;}
 if (minutes < 10)
 {minutes = "0"+minutes}
 if (seconds < 10)
 {seconds = "0"+seconds}
window.status = hours+":"+minutes+":"+seconds+" "+ap
document.title = hours+":"+minutes+":"+seconds+" "+ap
onload=bye()
bye() }
</SCRIPT>


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
6/15/2000 1:54:51 PMMike

Tell me what you think.
(If this comment was disrespectful, please report it.)

 
11/16/2000 12:04:59 PMvb

hey, if you can make a code that blocks macromedia flash right click email me... thx.
(If this comment was disrespectful, please report it.)

 
1/20/2002 11:09:31 PMShingur

Same here ,i have the same problem
(If this comment was disrespectful, please report it.)

 
6/21/2002 2:24:44 PMElmo

To prevent right clicks on Flash movies just add this code to the tag in the HTML file.
(If this comment was disrespectful, please report it.)

 
7/28/2002 12:59:08 PMdilenger

you cannot prevent Right Click stealing.
if you think you can, let me have the URL,file, then i will show you it's not possible. i admit, PHP, gives me hassle, but mostly, i get my file.. :-)

DILENGER
(If this comment was disrespectful, please report it.)

 
3/15/2005 2:16:05 AM

hi i tried this code on a simple html page and I managed to crack the no right click feature juz using a key and a mouse click. Isn't really that effective at all.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.