Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Disable right click - and source code view

Reply
Thread Tools

Disable right click - and source code view

 
 
techfiddle
Guest
Posts: n/a
 
      10-30-2006
Disabling the right click and hiding the source code view may be two
entirely separate issues. I Googled disable right click and
encountered three separate blocks of source code, none of which; worked
on my page at http://www.geocities.com/techfiddle//policies.html

I also searched in this group "disable right click" but the entires I
got were very old, probably not effective any longer.

I remember from the past there was very short snippet of code that
worked, but now I can't find it. I don't care so much about hiding the
source code (though that would be cool), as much as protecting my
images.

During the Googling (Ask, actually), there was a software program I
could buy for $40 which accomplishes this:

http://www.antssoft.com/htmlprotector/index.htm

So do I need to buy something or is there html that will accomplish
this?

Thanks!
Connie

THREE BLOCKS OF SOURCE CODE THAT DID *NOT* WORK:

<PRE>

______________________________


<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Original: Martin Webb () -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("I'm sorry, The Right click option on your mouse has been
disabled for the download window pages.");
return false;
}
return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
// End -->
</script>

</head>



________________


<SCRIPT language=JavaScript>
<!-- http://www.spacegun.co.uk -->
var message = "function disabled";
function rtclickcheck(keyp){ if (navigator.appName == "Netscape" &&
keyp.which == 3){ alert(message); return false; }
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
alert(message); return false; } }
document.onmousedown = rtclickcheck;
</SCRIPT>


_____________________________



<SCRIPT>function click() {if (event.button==2) {alert('Ooops...\nRight
click is disabled!');}}document.onmousedown=click// - -></SCRIPT>




____________________________

</PRE>

 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      10-30-2006
techfiddle wrote:
> Disabling the right click and hiding the source code view may be two
> entirely separate issues.


But they share some things in common:
1. They don't work.
2. They're pointless.
3. They really don't work.

> I Googled disable right click and
> encountered three separate blocks of source code, none of which; worked


Which browser are you using? Most modern browsers don't allow the page
to disable basic browser functions like right click.

> I also searched in this group "disable right click" but the entires I
> got were very old, probably not effective any longer.


Any techniques you found never were effective. Any advice you found to
stop wanting to do this is still 100% valid.

> I remember from the past there was very short snippet of code that
> worked, but now I can't find it.


It didn't work.

> I don't care so much about hiding the
> source code (though that would be cool), as much as protecting my
> images.


Don't put them on the web.

Or hire a lawyer and enforce your copyright by taking legal action
against people you steal your images.

> During the Googling (Ask, actually), there was a software program I
> could buy for $40 which accomplishes this:
>
> http://www.antssoft.com/htmlprotector/index.htm


Anyone who buys that has just wasted $4. It does a good job of making
your site inaccessible, but a poor job of protecting source code.

> So do I need to buy something or is there html that will accomplish
> this?


Nothing you buy can do this. Nothing in HTML can do this.

There are various JavaScript tricks that make it fractionally more
difficult for clueless users to steal your images or code. But that's
the best they can do.

Steve

 
Reply With Quote
 
 
 
 
Leif K-Brooks
Guest
Posts: n/a
 
      10-30-2006
techfiddle wrote:
> I remember from the past there was very short snippet of code that
> worked, but now I can't find it. I don't care so much about hiding the
> source code (though that would be cool), as much as protecting my
> images.


Try: rm -rf /home/techfiddle/public_html

That will make your images safe!
 
Reply With Quote
 
The Eclectic Electric
Guest
Posts: n/a
 
      10-30-2006
You can't do that with HTML. To be honest I personally hate sites that
disable right-click - there are many things I like to do with context menus
that I don't think website owners should be attempting to block.

+e

"techfiddle" <> wrote in message
news: oups.com...
> Disabling the right click and hiding the source code view may be two
> entirely separate issues. I Googled disable right click and
> encountered three separate blocks of source code, none of which; worked
> on my page at http://www.geocities.com/techfiddle//policies.html
>
> I also searched in this group "disable right click" but the entires I
> got were very old, probably not effective any longer.
>
> I remember from the past there was very short snippet of code that
> worked, but now I can't find it. I don't care so much about hiding the
> source code (though that would be cool), as much as protecting my
> images.
>
> During the Googling (Ask, actually), there was a software program I
> could buy for $40 which accomplishes this:
>
> http://www.antssoft.com/htmlprotector/index.htm
>
> So do I need to buy something or is there html that will accomplish
> this?
>
> Thanks!
> Connie
>
> THREE BLOCKS OF SOURCE CODE THAT DID *NOT* WORK:
>
> <PRE>
>
> ______________________________
>
>
> <SCRIPT LANGUAGE="JavaScript1.1">
> <!-- Original: Martin Webb () -->
>
> <!-- This script and many more are available free online at -->
> <!-- The JavaScript Source!! http://javascript.internet.com -->
>
> <!-- Begin
> function right(e) {
> if (navigator.appName == 'Netscape' &&
> (e.which == 3 || e.which == 2))
> return false;
> else if (navigator.appName == 'Microsoft Internet Explorer' &&
> (event.button == 2 || event.button == 3)) {
> alert("I'm sorry, The Right click option on your mouse has been
> disabled for the download window pages.");
> return false;
> }
> return true;
> }
>
> document.onmousedown=right;
> document.onmouseup=right;
> if (document.layers) window.captureEvents(Event.MOUSEDOWN);
> if (document.layers) window.captureEvents(Event.MOUSEUP);
> window.onmousedown=right;
> window.onmouseup=right;
> // End -->
> </script>
>
> </head>
>
>
>
> ________________
>
>
> <SCRIPT language=JavaScript>
> <!-- http://www.spacegun.co.uk -->
> var message = "function disabled";
> function rtclickcheck(keyp){ if (navigator.appName == "Netscape" &&
> keyp.which == 3){ alert(message); return false; }
> if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
> alert(message); return false; } }
> document.onmousedown = rtclickcheck;
> </SCRIPT>
>
>
> _____________________________
>
>
>
> <SCRIPT>function click() {if (event.button==2) {alert('Ooops...\nRight
> click is disabled!');}}document.onmousedown=click// - -></SCRIPT>
>
>
>
>
> ____________________________
>
> </PRE>
>



 
Reply With Quote
 
ato_zee@hotmail.com
Guest
Posts: n/a
 
      10-30-2006

On 30-Oct-2006, "techfiddle" <> wrote:

> I don't care so much about hiding the
> source code (though that would be cool), as much as protecting my
> images.


You might also have to think about Googles cache, of both pages
and images.
 
Reply With Quote
 
John Dunlop
Guest
Posts: n/a
 
      10-30-2006
Leif K-Brooks:

> Try: rm -rf /home/techfiddle/public_html
>
> That will make your images safe!


Bush is trying to rm -f /bin/laden.

Will that make his people safe?

--
Jock

 
Reply With Quote
 
techfiddle
Guest
Posts: n/a
 
      10-30-2006
>> Try: rm -rf /home/techfiddle/public_html

You lost me...what is this?

I'm using Mozilla.

No, I distinctly remember that there was something. That worked. I
was surprised none of the three I tried didn't work.

I would be satisified to block the clueless.

 
Reply With Quote
 
BootNic
Guest
Posts: n/a
 
      10-30-2006
> techfiddle <> wrote:
> news: . com
> Disabling the right click and hiding the source code view may be two
> entirely separate issues. I Googled disable right click and
> encountered three separate blocks of source code, none of which;
> worked on my page at
> http://www.geocities.com/techfiddle//policies.html
>
> I also searched in this group "disable right click" but the entires I
> got were very old, probably not effective any longer.
>
> I remember from the past there was very short snippet of code that
> worked, but now I can't find it. I don't care so much about hiding
> the source code (though that would be cool), as much as protecting my
> images.
>
> During the Googling (Ask, actually), there was a software program I
> could buy for $40 which accomplishes this:
>
> http://www.antssoft.com/htmlprotector/index.htm
>
> So do I need to buy something or is there html that will accomplish
> this?
>

[snip]
Disable image right-click by capturing oncontextmenu.

Bypass by
- disabling JavaScript temporarily
- using a browser that doesn't support oncontextmenu

Javascript is usually used to add functionality to a site, when
javascript is used to disable functionality, it becomes an annoyance.

<script type="text/javascript">
function annoyance1(e)
{
var elm=e.target||e.srcElement;
if(elm.tagName.toLowerCase()=='img')
{
if(e.target)
{
e.preventDefault();
e.stopPropagation();
}
else if(e.srcElement)
{
e.returnValue=false;
}
alert('WARNING:\nŻŻŻŻŻŻŻŻ \nWe have determined that right clicking '+
'on images\nmay lead to unnecessary ware on your mouse.\n\nWe wou'+
'ld like to encourage you to save your mouse.\n\nBy avoiding right clic'+
'king images in the future, you may\nprevent the extinction of your m'+
'ouse.\n\nThis message was brought to you by your friendly\nneighbor'+
'hood webmaster.');
}
}
if(window.attachEvent)
{
document.attachEvent('oncontextmenu',annoyance1);
}
else if(window.addEventListener)
{
document.addEventListener('contextmenu',annoyance1 ,null);
}
</script>

--
BootNic Monday, October 30, 2006 12:56 PM

A well-developed sense of humor is the pole that adds balance to your
step as you walk the tightrope of life
*William Arthur Ward*

 
Reply With Quote
 
Bergamot
Guest
Posts: n/a
 
      10-30-2006
techfiddle wrote:
>
> I don't care so much about hiding the
> source code (though that would be cool), as much as protecting my
> images.


Forget about trying to hide your source code. It is a wasted effort.

Protect your images by putting a watermark on them.

--
Berg
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      10-30-2006
In article
<. com>,
"techfiddle" <> wrote:

> >> Try: rm -rf /home/techfiddle/public_html

>
> You lost me...what is this?
>
> I'm using Mozilla.
>
> No, I distinctly remember that there was something. That worked. I
> was surprised none of the three I tried didn't work.
>
> I would be satisified to block the clueless.


You want to hide stuff from the sort that would be unlikely to
steal stuff from you to great effect?

--
dorayme
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
right click and view source Desmond HTML 13 03-26-2007 04:49 AM
How to disable mouse's right click and scroll bar hon123456 Javascript 4 12-20-2005 08:17 PM
Tool to enable Right click on pages where Right click is disabled tsteinke@gmail.com Computer Support 4 08-28-2005 11:53 PM
Tool to right click image in windows explorer and rotate image right or left 90 degrees siliconpi Digital Photography 2 11-29-2004 12:56 PM
How to disable right click menu in IE, Netscape 4 and Netscape 6 yaktipper Javascript 10 07-10-2003 04:15 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57