Forum Moderators: open

Message Too Old, No Replies

Right Click Blocker

         

Magpie

9:54 am on Mar 25, 2004 (gmt 0)

10+ Year Member



When you right click on a page, instead of bringing up the menu you usually get. How do you make it so a little message box comes up with text in it stopping other users?

All help is much appreciated

Kind Regards

Martin

DoppyNL

9:58 am on Mar 25, 2004 (gmt 0)

10+ Year Member



Haven't got a clue on how to do it, but...

Why would you want it on your site?
You can't hide a thing with it, and it will certainly annoy users that they won't be able to use that button and the popup menu. There are a lot of usefull options in there.

If I come to a site wich blocks the right mouse button, chances are quite big that I won't come back!

So why do you want it on your site? (it can be usefull sometimes, I know that too...)

creative craig

10:02 am on Mar 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you really want to do it search for no right click at a reputable search engine (if you can find one ;))

Craig

Magpie

10:13 am on Mar 25, 2004 (gmt 0)

10+ Year Member



<SCRIPT LANGUAGE="Javascript">
var isNS = (navigator.appName == "Netscape")? 1 : 0;
var EnableRightClick = 0;
if(isNS)
document.captureEvents(Event.MOUSEDOWN¦¦Event.MOUSEUP);
function mischandler(){
if(EnableRightClick==1){ return true; }
else {return false; }
}
function mousehandler(e){
if(EnableRightClick==1){ return true; }
var myevent = (isNS)? e : event;
var eventbutton = (isNS)? myevent.which : myevent.button;
if((eventbutton==2)¦¦(eventbutton==3)) return false;
}
function keyhandler(e) {
var myevent = (isNS)? e : window.event;
if (myevent.keyCode==96)
EnableRightClick = 1;
return;
}
document.oncontextmenu = mischandler;
document.onkeypress = keyhandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
//-->
</script>

I think ill use this 1... I doesn't give you an annoying pop up window... it just disables the menu...

The reason why i wanted it is because there are a couple of pages on my website that i didnt want a certian someone to veiw the source code of... mainly because he has stolen my layout and made it his own lol. I dont want it for the whole website becasue i have pictures of my band and MP3's that i want ppl to have.

Thanks

Martin

DoppyNL

10:17 am on Mar 25, 2004 (gmt 0)

10+ Year Member



disabling the right mouse button won't prevent people from stealing your code!
The simply go to their browsers menu and click "view source" and they can still see it!

You're probably better of not disabling it and don't annoy visitors wich is much more important.

Magpie

10:20 am on Mar 25, 2004 (gmt 0)

10+ Year Member



ah your right

o well... you've got a good point... ill leave it.

Didn't know you could still veiw te source via the menu.

Thanks for the help

Martin

victor

12:18 pm on Mar 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Two ideas:

1 Have a secure logon to your site so only known users can get access. Make them agree to Terms of Service so you'll get oodles of compensation off them if they use right click.

2. Have a secure logon and, as part of the signup procedure download a special purpose browser or a modified mouse driver. Only allow access if these are in use.

These are both simple ways to reduce your user population to those who will adopt your access requirements.

asquithea

9:30 pm on Mar 26, 2004 (gmt 0)

10+ Year Member




1. Have a secure logon to your site so only known users can get access. Make them agree to Terms of Service so you'll get oodles of compensation off them if they use right click.
2. Have a secure logon and, as part of the signup procedure download a special purpose browser or a modified mouse driver. Only allow access if these are in use.

Heh... Workable and ludicrous respectively ;-) I guess that's one way of reducing your user base to nothing.

When you transmit data to a browser, it is plainly available to the user. Even SSL only encrypts at the transport level, and that means that any user can examine your source code. Moreover, some modern browsers, such as Mozilla Firefox, actually come with a built in DOM Inspector that is used to analyse page structure where it is not clear from the source. You're wasting your time with technical solutions for HTML content.

You have three options:
1) Write the site using a plugin that protects content. Flash might be a possibility. Bear in mind that increasing technical complexity decreases reliability and target audience.

2) Make your content dynamic. There's little you can do in terms of protecting general page structure, but if your page content changes frequently and contains strong ties to your domain, it'll be more difficult to rip off your content.

3) Legal action. This is the easiest to implement, but the hardest to enforce. You can't copyright something as basic as page layout.

My conclusion: Get over it.

danieljean

1:03 am on Mar 27, 2004 (gmt 0)

10+ Year Member



Yup, get over it.

If you disable right-click, it will annoy me because I can't use mouse nav. Plus, it'll make me curious to see what you're trying to hide.

ronin

2:38 am on Mar 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Once you download a file from the internet, it's on your machine. Right there in Temporary Internet Files.

There are one or two good reasons for using the no right mouse click javascript though which often get overlooked.

For instance, if you have a number of large scale original photos on your site. You can't stop people taking those files and uploading them onto their own site. If you're on a windows server, as far as I know, you can't even stop people from using up your bandwidth by creating a live link to the image on your site from their site (if they're determined they'll figure out the filepath eventually).

However you can stop those who don't know any better from linking directly to an image on your site accidentally. Chances are if a webmaster is determined to copy a large photo or image and it only ever appears in a window without a menu and the right-click is disabled and they _still_ know how to find the filepath... they probably know enough about the web to make their own copy of the photo rather than pulling it directly off your site. (Malicious intent notwithstanding).

How I wish my site was hosted on an apache server

mep00

11:07 am on Mar 28, 2004 (gmt 0)

10+ Year Member



I went to a site which did that to me the other day (VERY ANNOYING) for no reason I could see. Since I wanted to open a link in a new tab, I disable js.

Bye, bye "no right click." :)

It annoyed me again when another site's page didn't load properly until I turned js back on.

bull

11:21 am on Mar 28, 2004 (gmt 0)

10+ Year Member



Pressing F12 in Opera, problem solved.
Using those scripts is simply childish.

R1chard

3:28 pm on Mar 30, 2004 (gmt 0)

10+ Year Member



^ or Opera users can press Ctrl+F3 to view source.

And Mozilla users can press Ctrl+U

But yeah, I never return to sites that disable my functionality. I often use Mozilla's context menu to "Web search for" highlighted words.

HelenDev

3:37 pm on Mar 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



^ or Opera users can press Ctrl+F3 to view source.
And Mozilla users can press Ctrl+U

...and ie5 users can try and view source, get annoyed when it won't work, try and remember if they need to clear out their temporary internet files or something, then switch to another browser...

[/end slightly off-topic rant]

ram_mac

9:52 pm on Mar 30, 2004 (gmt 0)

10+ Year Member



. . . or just use an offline browser / curl / wget to download your data and view it locally . . .

There is no effective way of stopping someone who really wants access to your content (aside of simply not putting it online) - there will always be a way of getting to it whether it is html, jpeg, flash, pdf or whatever.

vkaryl

2:01 am on Mar 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Really, the only people you stop with a right-click blocker script are those who are basically "honest" anyway....

I use one on a site I did for my daughter, who does art quilts worth thousands of dollars; and on another site where an artist of some note allowed me to set up a "gallery" of her paintings of horses and unicorns. Of course people who are 'net savvy would still be able to get the graphics - one can only hope that most of them won't because they get the nicely-phrased "please don't" alert message and are just content with looking from then on.

Until everyone in this world is fully ready to not only acknowledge but protect copyright, anything placed in 'netspace will be vulnerable. The script I use does NOT prevent anyone but the honest from obtaining the information and/or graphics....

[I have a lot of interest in this sort of thing: I not only design and run sites, I write fantasy, sci-fi, and romance - copyright is an EXTREMELY important concept for me, as well as a vital part of my "business situation".)

sderenzi

3:42 pm on Apr 1, 2004 (gmt 0)



If I were you I'd not consider using the right-click pop-up message. It is simple to do but I shalln't tell you because I'm certain you've already found out, but also because I use to implement them. Finally a good webmaster told me that using them was a hastle but also made users less than happy.