Jump to content
xisto Community
djleli

Deactivate right click in internet explorer

Recommended Posts

<style onload="function noRightClick() {if(event.button==2) [br]{alert('CopyrightŽ by Bullit')}}document.onmousedown=noRightClick"> </style>
[/br]
OR

<noscript>You need to have JavaScript enabled in order to view this page correctly!</noscript> [/br]<script type="text/javascript"><!-- [br]var message="don't do that"; [/br]function clickIE4(){ [br]if (event.button==2){ [/br]alert(message); [br]return false; [/br]} [br]} [/br]function clickNS4(e){ [br]if (document.layers||document.getElementById&&!document.all){ [/br]if (e.which==2||e.which==3){ [br]alert(message); [br]return false; [/br]} [br]} [/br]} [/br]if (document.layers){ [br]document.captureEvents(Event.MOUSEDOWN); [/br]document.onmousedown=clickNS4; [br]} [/br]else if (document.all&&!document.getElementById){ [br]document.onmousedown=clickIE4; [br]} [/br]document.oncontextmenu=new Function("alert(message);return false") [/br]//--></script>

Share this post


Link to post
Share on other sites

That script, or more specifically the behavior it supports, its useless as there a lot of ways to get around the no right button trick. Copyright concerns are legitimate, but it also annoys visitors if you try to control any of the functionality inherent to their end.

Share this post


Link to post
Share on other sites

yeah a lot of ppl know that you can go around this by viewing sources or other ways but there are many ppl that never knew about this and so they will be cot in it. ALso it makes te site a bit more pro

Share this post


Link to post
Share on other sites

i use to think it looked pro but now i think its more a tackie affect... for some reason effects like that and things like stuff chasing you cursor i really dont like... just gets in the way when i'm reading somthing on the page...

Share this post


Link to post
Share on other sites

Two ways I can think of gettings around this off the top of my head:Highlight + Ctrl & CView SourceSheesh, when I did this one day in class, it amazed my Science Teacher.How sad, eh?Although, I've never seen that <style> script before, I'm going to go do a search on it. :D

Share this post


Link to post
Share on other sites

The best right click protection what I find on Internet are:oncontextmenu="return false" ondragstart="return false" onselectstart="return false"Put this code direct in body element. For example:<body topmargin="0" leftmargin="0" oncontextmenu="return false" ondragstart="return false" onselectstart="return false"></body>hasa :D _ _ _ _ _ _ _ _ _ _ _ _The only true success is when you live fife your own way

Share this post


Link to post
Share on other sites

But it's also completely useless and will also annoy your users. I reccommend against using anything to disable rightclicking, since it's so easy to get around them. And, yes, even newbies can figure them out. Screenshotting, anyone?Also, you're disabling several helpful, legit uses for rightclicking, such as 'copy link location' and 'open in a new window/tab'. Or rightclicking and selecting 'add to favorites/bookmarks', which surely is something that you would want your users to do, heh.

Share this post


Link to post
Share on other sites

<body topmargin="0" leftmargin="0" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
as hasa said is indeed the best. It blocks right clicking and dragging so no ctrl+C. But if you really want the source safe you should best open in a new window where you dont allow the toolbars, and even better is using frames. Ok you think frames? easy to find the page, view -> source and you can see all the urls of each frame... BUT haha,
<script language="javascript">[/br]if (top.document==self.document)[br]window.location.href='index.html'[/br]</script>


index.html must be the site with the frames (you can shame into for ex frames.htm or whatever) The last code makes that the page can't be viewed except in the frames! See you stupid newbie copiers. But I know a way to get the source :P ...

Share this post


Link to post
Share on other sites

lolz...there is one thing which you guys havent considered. And that is that someone can easily click on FILE>SAVE AS>LOCAL DIRECTORY>SAVE. Will preventing right clicking be able to save you from that?

Share this post


Link to post
Share on other sites

one other thing is if you put your cursor on a picture like a jpg and it pops up this tooltip that has options like save the picture and something else. There is a code that stops this but i forgot. I just wanted to say that. If your thinking of protecting your code. Oh and copying the whole screen.

Share this post


Link to post
Share on other sites

Well I think it's absolutely pointless disabling right click for a site with images and such. It's pointless because these images are already loded into the Temporary Internet files, so you already have them saved on your computer in the first place.

 

Also it's extremely annoying for me to disable right clicking, as I always open up new links in new tabs in Firefox and wait for them to load while I'm reading the current page.

 

Not a good idea at all. It also cheapens your site and makes you look like a stinge.

Share this post


Link to post
Share on other sites

that was exactly what i was saying. i dont think that it is right to disable right clicking on your website cos it really irritates people that are viewing your web pages.I will never going to disable right clicking on my website cos I know how i feel whenever i right click on a site and get some kinda creampie message from the site.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.