Disabling Copy/Paste function

  • INeverPay
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 22, 2004
  • Posts: 6
  • Status: Offline

Post July 22nd, 2004, 4:44 pm

Hi!

I was just wondering... can someone help me with a javascript where if someone comes to my website, their Copy/Paste functions will be greyed out from their menu of the browser or whatever program (notepad, word) they initiate while my site is open?

I want to make it harder for people to take codes from my site.

Thanks in advance. :oops:
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 22nd, 2004, 4:44 pm

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 22nd, 2004, 5:38 pm

This goes right along with the "hiding source topics"
http://www.ozzu.com/programming-forum/hiding-source-code-t117.html (7 pages long)


//Edit, I was wrong, You can disable copy & paste.
Strong with this one, the sudo is.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post July 22nd, 2004, 7:57 pm

I echo what joebert said in this post and in response to the other locked one. Forget it. You are wasting your time looking.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 22nd, 2004, 9:31 pm

After being shown http://www.weblockpro.com/home.php I have been proved wrong that this can't be done :oops:

However It took me less than 30 seconds to figure out all I had to do was open notepad with the site closed & manually type in the url to have the sites source code in front of me.
Strong with this one, the sudo is.
  • INeverPay
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 22, 2004
  • Posts: 6
  • Status: Offline

Post July 22nd, 2004, 11:30 pm

I would like to use a similar script code on my site that the weblockpro used.

I really don't care about my site's sources being available but would like to give anyone trying a hard time doing it and this kind of script would be the answer to standard web surfers.

A quick script code, if anyone can assist, would be appreciated.

Thank you. :)
  • this213
  • Guru
  • Guru
  • User avatar
  • Joined: Mar 01, 2004
  • Posts: 1242
  • Loc: ./
  • Status: Offline

Post July 23rd, 2004, 12:01 am

I'll do it for $500

I figured after three or four post, he ought to get an answer of some kind
  • INeverPay
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 22, 2004
  • Posts: 6
  • Status: Offline

Post July 23rd, 2004, 1:46 am

Thanks but I figured out the code.

It basically uses a script to make the clipboard null so that copy/paste function dies. Also, with the use of Copy if possible, it erases the clipboard simultaneously, thus Paste function is disabled.

:D
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 23rd, 2004, 10:42 am

Would you mind posting the code here so that others in the future will have the answer?
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • INeverPay
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 22, 2004
  • Posts: 6
  • Status: Offline

Post July 24th, 2004, 7:05 am

Bigwebmaster wrote:
Would you mind posting the code here so that others in the future will have the answer?


Sure, here it is.

PHP Code: [ Select ]
<script language=javascript>
 
 
 
if(window.location.protocol.indexOf("file")!=-1){
 
location="about&#058;blank";
 
 
 
}
 
</script>
 
<script language=javascript>
 
if(document.domain.toLowerCase().replace("www.","")!="yourdomain.com".toLowerCase().replace("www.","")){
 
alert("Invalid Domain");
 
location="about&#058;blank";
 
 
 
}
 
</script>
 
<script language=javascript>
 
if(document.all){
 
_fc='<'+'div style="position:absolute;left:-1000px;top:-1000px;width:60px;height:35px;z-index:1">' + '<'+'input type="button" name="_xqq" value="" onClick=_ccd() style="visibility:hidden"><'+'/div>';
 
document.write(_fc);
 
function _ccd(){
 
clipboardData.clearData()
 
}
 
;
 
function _cce(){
 
_xqq.click();
 
setTimeout("_cce()",300)
 
}
 
;
 
setTimeout("_cce()",1000);
 
 
 
}
 
</script>
 
<script language=javascript>
 
function _ng(){
 
if (document.all) for (i = 0;
 
i< document.images.length;
 
i++){
 
z = document.images(i);
 
z.galleryImg = 'no'
 
}
 
 
 
}
 
_ng();
 
</script>
 
<script language=javascript>
 
function _np1(){
 
for(wi=0;
 
wi<document.all.length;
 
wi++){
 
if(document.all[wi].style.visibility!="hidden"){
 
document.all[wi].style.visibility="hidden";
 
document.all[wi].id="gwp"
 
}
 
 
 
}
 
 
 
}
 
;
 
function _np2(){
 
for (wi=0;
 
wi<document.all.length;
 
wi++){
 
if(document.all[wi].id=="gwp")document.all[wi].style.visibility=""
 
}
 
 
 
}
 
;
 
window.onbeforeprint=_np1;
 
window.onafterprint=_np2;
 
</script>
 
<script language=javascript>
 
function _ni(){
 
if(document.all){
 
document.onselectstart=function (){
 
return false
 
}
 
;
 
document.ondragstart=function (){
 
return false
 
}
 
;
 
setTimeout("_ni", 3000);
 
 
 
}
 
 
 
}
 
;
 
_ni();
 
function _nn(){
 
if(document.layers||window.sidebar){
 
var t= document.getSelection();
 
if(t !=""){
 
if(!window.find){
 
alert("Function Disabled.");
 
location="about&#058;blank";
 
 
 
}
 
else{
 
if(t !=" "){
 
window.find(" ")
 
}
 
;
 
 
 
}
 
 
 
}
 
;
 
setTimeout("_nn()",20)
 
}
 
 
 
}
 
_nn();
 
</script>
 
<script language=javascript>
 
function _nrcie(){
 
return false
 
}
 
function _nrcns(e){
 
if(e.which==2||e.which==3)return false
 
}
 
if(document.layers){
 
document.captureEvents(Event.MOUSEDOWN);
 
document.onmousedown=_nrcns
 
}
 
document.oncontextmenu=_nrcie;
 
</script>
 
<script language=javascript>
 
function _nsb(){
 
window.status="Page protected by yourdomain.com";
 
setTimeout("_nsb()",10)
 
}
 
_nsb();
 
</script>
  1. <script language=javascript>
  2.  
  3.  
  4.  
  5. if(window.location.protocol.indexOf("file")!=-1){
  6.  
  7. location="about&#058;blank";
  8.  
  9.  
  10.  
  11. }
  12.  
  13. </script>
  14.  
  15. <script language=javascript>
  16.  
  17. if(document.domain.toLowerCase().replace("www.","")!="yourdomain.com".toLowerCase().replace("www.","")){
  18.  
  19. alert("Invalid Domain");
  20.  
  21. location="about&#058;blank";
  22.  
  23.  
  24.  
  25. }
  26.  
  27. </script>
  28.  
  29. <script language=javascript>
  30.  
  31. if(document.all){
  32.  
  33. _fc='<'+'div style="position:absolute;left:-1000px;top:-1000px;width:60px;height:35px;z-index:1">' + '<'+'input type="button" name="_xqq" value="" onClick=_ccd() style="visibility:hidden"><'+'/div>';
  34.  
  35. document.write(_fc);
  36.  
  37. function _ccd(){
  38.  
  39. clipboardData.clearData()
  40.  
  41. }
  42.  
  43. ;
  44.  
  45. function _cce(){
  46.  
  47. _xqq.click();
  48.  
  49. setTimeout("_cce()",300)
  50.  
  51. }
  52.  
  53. ;
  54.  
  55. setTimeout("_cce()",1000);
  56.  
  57.  
  58.  
  59. }
  60.  
  61. </script>
  62.  
  63. <script language=javascript>
  64.  
  65. function _ng(){
  66.  
  67. if (document.all) for (i = 0;
  68.  
  69. i< document.images.length;
  70.  
  71. i++){
  72.  
  73. z = document.images(i);
  74.  
  75. z.galleryImg = 'no'
  76.  
  77. }
  78.  
  79.  
  80.  
  81. }
  82.  
  83. _ng();
  84.  
  85. </script>
  86.  
  87. <script language=javascript>
  88.  
  89. function _np1(){
  90.  
  91. for(wi=0;
  92.  
  93. wi<document.all.length;
  94.  
  95. wi++){
  96.  
  97. if(document.all[wi].style.visibility!="hidden"){
  98.  
  99. document.all[wi].style.visibility="hidden";
  100.  
  101. document.all[wi].id="gwp"
  102.  
  103. }
  104.  
  105.  
  106.  
  107. }
  108.  
  109.  
  110.  
  111. }
  112.  
  113. ;
  114.  
  115. function _np2(){
  116.  
  117. for (wi=0;
  118.  
  119. wi<document.all.length;
  120.  
  121. wi++){
  122.  
  123. if(document.all[wi].id=="gwp")document.all[wi].style.visibility=""
  124.  
  125. }
  126.  
  127.  
  128.  
  129. }
  130.  
  131. ;
  132.  
  133. window.onbeforeprint=_np1;
  134.  
  135. window.onafterprint=_np2;
  136.  
  137. </script>
  138.  
  139. <script language=javascript>
  140.  
  141. function _ni(){
  142.  
  143. if(document.all){
  144.  
  145. document.onselectstart=function (){
  146.  
  147. return false
  148.  
  149. }
  150.  
  151. ;
  152.  
  153. document.ondragstart=function (){
  154.  
  155. return false
  156.  
  157. }
  158.  
  159. ;
  160.  
  161. setTimeout("_ni", 3000);
  162.  
  163.  
  164.  
  165. }
  166.  
  167.  
  168.  
  169. }
  170.  
  171. ;
  172.  
  173. _ni();
  174.  
  175. function _nn(){
  176.  
  177. if(document.layers||window.sidebar){
  178.  
  179. var t= document.getSelection();
  180.  
  181. if(t !=""){
  182.  
  183. if(!window.find){
  184.  
  185. alert("Function Disabled.");
  186.  
  187. location="about&#058;blank";
  188.  
  189.  
  190.  
  191. }
  192.  
  193. else{
  194.  
  195. if(t !=" "){
  196.  
  197. window.find(" ")
  198.  
  199. }
  200.  
  201. ;
  202.  
  203.  
  204.  
  205. }
  206.  
  207.  
  208.  
  209. }
  210.  
  211. ;
  212.  
  213. setTimeout("_nn()",20)
  214.  
  215. }
  216.  
  217.  
  218.  
  219. }
  220.  
  221. _nn();
  222.  
  223. </script>
  224.  
  225. <script language=javascript>
  226.  
  227. function _nrcie(){
  228.  
  229. return false
  230.  
  231. }
  232.  
  233. function _nrcns(e){
  234.  
  235. if(e.which==2||e.which==3)return false
  236.  
  237. }
  238.  
  239. if(document.layers){
  240.  
  241. document.captureEvents(Event.MOUSEDOWN);
  242.  
  243. document.onmousedown=_nrcns
  244.  
  245. }
  246.  
  247. document.oncontextmenu=_nrcie;
  248.  
  249. </script>
  250.  
  251. <script language=javascript>
  252.  
  253. function _nsb(){
  254.  
  255. window.status="Page protected by yourdomain.com";
  256.  
  257. setTimeout("_nsb()",10)
  258.  
  259. }
  260.  
  261. _nsb();
  262.  
  263. </script>
  • omirix
  • Banned
  • Banned
  • User avatar
  • Joined: Jul 23, 2004
  • Posts: 129
  • Loc: 127.0.0.1
  • Status: Offline

Post July 24th, 2004, 7:18 am

That's definately pointless. You can just File > Save As > haxme.html

Then you just open with notepad, and you get the source... Not too hard. Also, with mozilla, hit Ctrl-U to unblock those pesky scripts that block File > Save'ing
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Joined: May 22, 2004
  • Posts: 3415
  • Loc: Richland, WA
  • Status: Offline

Post July 24th, 2004, 10:28 am

but who is going to spend the time to do that? not alot of people will think of that and if they do then they proably wont.

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 170 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.