Prevent mouse right click

G

Gpr0496

I found a website that doesn't allow you to right click on the page at all...
www.allsoccertraining.com
How is this done? And does it keep anyone from copying the content? I am
designing a website and was wondering if I could apply this idea to mine.
Thank you for your help....
 
A

Andrew Murray

Actually you can make the right click work.

Turn off javascript in your browser. Some browsers mightn't actually
support the function to block it e.g. Firefox and Opera.

In IE 6.0, if you hold down the left mouse button then click the right, the
context menu will pop up.

It does work in Netscape when using the IE rendering engine (the "Display
like Internet Explorer" option) but not "Display like Firefox".

So it's a give and take thing - not foolproof.
 
K

Kevin Spencer

THERE IS NO WAY TO PREVENT COPYING OF CONTENT IN A WEB PAGE.

If you had scanned this newsgroup, you would have seen that this issue comes
up frequently, and the answer is always the same.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
 
C

Craig Allen

Youabsolutely can prevent anyone right clicking on any page in your web.

Add this script to the head before the body:

<script language=JavaScript>
<!--

//Disable right click script III- By Renigade ([email protected])
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
</script>

It is damn secure
 
S

Swabbie

Are you saying that you have to turn off javascript before you try holding
the left mouse button and clicking the right one or just do the mouse part?
 
A

Andrew Murray

No I meant there's (at least) two ways around the "no right click"

1) Turn Javascript Off; since the no right click thing is written with
javascript.

OR

2) Hold the left mouse button down and click the right button while holding
the left down (this might/might not work - depends on your mouse etc, but
for me, I could get around the no right click on the OP's site.
 
S

Swabbie

On my page I have a JavaScript that I use to have no right click and number
2 does not work with my script but I guess it would most certainly allow you
to right click if you turned JavaScript off?
 
A

Andrew Murray

Some browsers actually allow certain functions to be disabled (such as
disallowing popup windows or no-right-click scripts) eg in Firefox, you can
disable the scripts that disable the right click menu; that is, override the
script and restore the right click to function correctly without disabling
JS completely (same with netscape or Opera I think).
 
K

Kevin Spencer

Considering the fact that disabling the mouse from right-clicking doesn't
accomplish anything useful, have you given any thought to the idea that
disabling any type of user input mechanism without good reason is only
likely to irritate the user? fOR EXAMPLE, IMAGINE HOW YOU WOULD FEEL IF THE
CAPS LOCK KEY OF YOUR KEYBOARD COULD NOT BE TURNED OFF. iT IS MUCH MORE
LIKELY THAT DISABLING THE RIGHT CLICK OF YOUR MOUSE WILL DRIVE PEOPLE AWAY
FROM YOUR WEB SITE. oF COURSE, IF THAT IS YOUR INTENTION, GO RIGHT AHEAD.

--
HTH,

kEVIN sPENCER
mICROSOFT mvp
pROFESSIONAL cHICKEN sALAD aLCHEMIST

wHAT YOU SEEK IS WHAT YOU GET.
 
R

Rob Giordano \(Crash\)

And, how is it "damn secure"? It isn't - you know that right??


| Youabsolutely can prevent anyone right clicking on any page in your web.
|
| Add this script to the head before the body:
|
| <script language=JavaScript>
| <!--
|
| //Disable right click script III- By Renigade ([email protected])
| //For full source code, visit http://www.dynamicdrive.com
|
| var message="";
| ///////////////////////////////////
| function clickIE() {if (document.all) {(message);return false;}}
| function clickNS(e) {if
| (document.layers||(document.getElementById&&!document.all)) {
| if (e.which==2||e.which==3) {(message);return false;}}}
| if (document.layers)
| {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
| else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
|
| document.oncontextmenu=new Function("return false")
| // -->
| </script>
|
| It is damn secure
|
|
| "Gpr0496" wrote:
|
| > I found a website that doesn't allow you to right click on the page at
all...
| > www.allsoccertraining.com
| > How is this done? And does it keep anyone from copying the content? I
am
| > designing a website and was wondering if I could apply this idea to
mine.
| > Thank you for your help....
 
R

Rob Giordano \(Crash\)

double dang



| If anything, it's damn insecure.
|
| --
| Murray
| --------------
| MVP FrontPage
|
|
| | > And, how is it "damn secure"? It isn't - you know that right??
| >
| >
| > | > | Youabsolutely can prevent anyone right clicking on any page in your
web.
| > |
| > | Add this script to the head before the body:
| > |
| > | <script language=JavaScript>
| > | <!--
| > |
| > | //Disable right click script III- By Renigade ([email protected])
| > | //For full source code, visit http://www.dynamicdrive.com
| > |
| > | var message="";
| > | ///////////////////////////////////
| > | function clickIE() {if (document.all) {(message);return false;}}
| > | function clickNS(e) {if
| > | (document.layers||(document.getElementById&&!document.all)) {
| > | if (e.which==2||e.which==3) {(message);return false;}}}
| > | if (document.layers)
| > |
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
| > | else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
| > |
| > | document.oncontextmenu=new Function("return false")
| > | // -->
| > | </script>
| > |
| > | It is damn secure
| > |
| > |
| > | "Gpr0496" wrote:
| > |
| > | > I found a website that doesn't allow you to right click on the page
at
| > all...
| > | > www.allsoccertraining.com
| > | > How is this done? And does it keep anyone from copying the content?
| > I
| > am
| > | > designing a website and was wondering if I could apply this idea to
| > mine.
| > | > Thank you for your help....
| >
| >
|
|
 

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

Top