Unable to view source

O

Otuatail

Can anyone tell me what code I use so that when someone right clicks on
a web page youi get the Whats this message instead of a popup window
for view source or save image.

Paul
 
R

rf

Otuatail said:
Can anyone tell me what code I use so that when someone right clicks on
a web page youi get the Whats this message instead of a popup window
for view source or save image.

What if I want to right click and use the context menu to bookmark your
page? You have just lost me as a return visitor.

It's easy to inhibit right click and piss off you visitors. However anybody
who wants to look at your source has at their disposal about 8 other ways of
getting to it.

Oh, by the way, there is this rule: The desire to hide your source code from
anybody else is in inverse proportion to the value of that code to anybody
else.

Finally, did it ever occur to you to search the history of this newsgoup?
This question comes up at least once a week and gives us lots of fun... Let
the flames begin.

Cheers
Richard.
 
P

PeterMcC

Otuatail said:
Can anyone tell me what code I use so that when someone right clicks
on a web page youi get the Whats this message instead of a popup
window for view source or save image.

It's a waste of time - anyone who has the ability to use copied source has
the ability to get round the no-right-click script. If it's JavaScript code
that you're after, all anyone has to do is switch off js.

By the time a browser is displaying the page, the source is in the cache of
the visitor's computer and, once it's there, it's always going to be a
simple task to look at it - and the same with images.

Your site may be the exception to the rule but, in my experience, the more
someone tries to hide their code, the less it is worth stealing. The major
sites - which have cost hundreds of thousands to develop - don't use
no-right-click scripts and they have a far greater investment to protect.

If you really must have a script, there are 2,000,000+ pages referenced at:
http://www.google.com/search?q=right+click+script

Or you could let others explain the problem more eloquently than I by having
a look at:
http://www.allmyfaqs.com/faq.pl?Hide_source
 
T

Trevor George

Otuatail wrote in message ...
Can anyone tell me what code I use so that when someone right clicks on
a web page youi get the Whats this message

I used this javascript below on one of my 'hobby' sites as lots of people
were 'Hotlinking' to the images in message-forums.

It's not perfect but it's cured the 'Hotlinking' problem. It's only placed on
the "Enlarged images" pages if you want to try it here at ...
http://www.Gilera-Nexus.co.uk - Just alter the text to suit your own
requirements.


<script type="text/javascript">
<!--
var ErrMsg = "Please do not 'Hotlink' to these images";
function disableRightClick (btnClick)
{
if (navigator.appName == "Netscape" && btnClick.which == 3)
{
alert(ErrMsg);
return false;
}
else if (navigator.appName == "Microsoft Internet Explorer" && event.button
== 2)
{
alert(ErrMsg);
return false;
}
}
document.onmousedown = disableRightClick;
-->
</script>

Cheers ..... Trevor, Bristol, UK. http://www.OnMyWindow.co.uk
 
P

PeterMcC

Trevor said:
Otuatail wrote in message ...

I used this javascript below on one of my 'hobby' sites as lots of
people were 'Hotlinking' to the images in message-forums.

It's not perfect but it's cured the 'Hotlinking' problem. It's only
placed on the "Enlarged images" pages if you want to try it here at
... http://www.Gilera-Nexus.co.uk - Just alter the text to suit
your own requirements.


<script type="text/javascript">
<!--
var ErrMsg = "Please do not 'Hotlink' to these images";
function disableRightClick (btnClick)
{
if (navigator.appName == "Netscape" && btnClick.which == 3)
{
alert(ErrMsg);
return false;
}
else if (navigator.appName == "Microsoft Internet Explorer" &&
event.button == 2)
{
alert(ErrMsg);
return false;
}
}
document.onmousedown = disableRightClick;
-->
</script>

Cheers ..... Trevor, Bristol, UK. http://www.OnMyWindow.co.uk

I agree with you about the problem of hot-linking but I'm afraid that the
above doesn't stop it. The script makes it marginally harder to find the
file name for the image - one has to simply switch off js - but it doesn't
actually affect hot-linking. That has to be done at the server.
 
T

Trevor George

PeterMcC wrote in message ...
I agree with you about the problem of hot-linking
but I'm afraid that the above doesn't stop it.

Obviously the folks who were 'hotlinking' didn't have quite the
*intelligence* that the regulars on this group have !! (or else they felt
sorry for me).
but it doesn't
actually affect hot-linking. That has to be done at the server.

I realise that, but it was just a quick option when I realised the drain on
my bandwidth was occurring.
 
D

Default User

rf said:
What if I want to right click and use the context menu to bookmark your
page? You have just lost me as a return visitor.


Or the thing I use a lot since getting Mozilla, Open Link in New Tab.
Tabbed browsing is great, so it eally pisses me when someone monkeys
with the right click.




Brian Rodenborn
 
W

Whitecrest

What if I want to right click and use the context menu to bookmark your
page? You have just lost me as a return visitor.

I always look at this (and similar issue) like the "no shirt no shoes,
no service" signs.

It's not that I don't want you business, I just want you to do it my
way. If you don't want to do it my way then fine, don't come in.

At a store on the boardwalk of a beach, you would be silly to have that
sign. At a fine restaurant you would be silly to not have it.
Different things work for different sites.
 
W

Whitecrest

What if I want to right click and use the context menu to bookmark your
page? You have just lost me as a return visitor.

Aside from my previous post, in this case, I completely agree with you.
He is likely to piss off visitors tat try to right click on the page.
Oh, by the way, there is this rule: The desire to hide your source code from
anybody else is in inverse proportion to the value of that code to anybody
else.

Right on the money

Finally, did it ever occur to you to search the history of this newsgoup?
This question comes up at least once a week and gives us lots of fun... Let
the flames begin.

See my previous post....... ;-}
 
L

Leif K-Brooks

Default said:
Or the thing I use a lot since getting Mozilla, Open Link in New Tab.
Tabbed browsing is great, so it eally pisses me when someone monkeys
with the right click.

I use my middle mouse button for that. It's less clicking.
 
B

brucie

Can anyone tell me what code I use so that when someone right clicks on
a web page youi get the Whats this message instead of a popup window
for view source or save image.

if you attempt to disable my thumb and middle ring finger i'm going to
charge you with assault or break your arm, whichever at the time will
give me the greatest satisfaction, i think that is only fair.

santa *is* bringing me this for xmas or hes a dead man:
http://www.fingerworks.com/lp_product.html then my "right click" will
 
S

Steve R.

Default User wrote in message ...
My mouse doesn't have a middle button.

That's 'cos you're a *Default User* :~)

Did you really configure your Usenet name to be that ?
Or was it just left as *Default User* ?

Steve.
 
D

Default User

Steve R. said:
Default User wrote in message ...

That's 'cos you're a *Default User* :~)

Did you really configure your Usenet name to be that ?
Or was it just left as *Default User* ?


Left it that way. It started as a reminder to myself that I needed to
get a better newsreader than Netscape. Now it's been so long that it's
become my identity.



Brian Rodenborn
 
G

George Self

Otuatail said:
Can anyone tell me what code I use so that when someone right clicks on
a web page youi get the Whats this message instead of a popup window
for view source or save image.

Paul

If you have some sort of code to hide you might try using a server-side
scripting language (like PHP). That code is stripped from the file before
it's served to your visitor.

--George
 
R

rf

George Self said:
If you have some sort of code to hide you might try using a server-side
scripting language (like PHP). That code is stripped from the file before
it's served to your visitor.

Er, yes. However the HTML is still there, as are the images. You can not
obfuscate an image with PHP :)

Cheers
Richard.
 
L

Leif K-Brooks

George said:
If you have some sort of code to hide you might try using a server-side
scripting language (like PHP). That code is stripped from the file before
it's served to your visitor.

He's talking about hiding HTML, which doesn't do logic. PHP still
generates HTML (or something else), and the resulting HTML is still visible.
 
B

brucie

If Santa brings you that, his sleigh will be hijacked by me.

i haven't actually given him my final decision yet. the split layout
concerns me. i think i've spent too many years on a "normal" keyboard.
i'm thinking of getting a cheap split keyboard (they're only $20) to see
if i can get used to it first.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top