JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 24th, 2007, 05:03 AM
Psycho77 Psycho77 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 4 Psycho77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 48 sec
Reputation Power: 0
Lightbulb Javascript to disable right-click on Mozilla Firefox & Internet Explorer

Hi All,

Here is a javascript code for you to disable right-click on both Internet Explorer & Mozilla Firefox. Hope this code can help you all with your coding problems.

Best Regards to All.

Code:
 
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")

Reply With Quote
  #2  
Old March 7th, 2007, 02:49 AM
daddy_rabbit daddy_rabbit is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Location: Missouri USA
Posts: 1 daddy_rabbit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 33 sec
Reputation Power: 0
Thanks.

This was a snap and worked perfecty. I don't disable right-click as a rule, but I am developing a site that should not allow image snatching.

This will eliminate the casual user's ability to do that.

Reply With Quote
  #3  
Old May 29th, 2008, 03:43 PM
abernet1 abernet1 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 1 abernet1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 9 sec
Reputation Power: 0
Hello,

Your script sounds like just what I need, I have a blog web site and I pasted the above script above the body as an HTML and when I viewd mt web site it appeared as text, PLEASE HELP! (mmatakeover@yahoo.ca)

Thanks

Reply With Quote
  #4  
Old July 6th, 2008, 03:05 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 553 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 1 m 33 sec
Reputation Power: 5
script as text

Hi abernet1, welcome to the forums,
IMHO "disable right-click" is a waste of time, but anyway, did you put the code inside script tags?
__________________
WP plugins - Error Reporting, Clean Options
http://www.mittineague.com/dev/er.php
http://www.mittineague.com/dev/co.php

Reply With Quote
  #5  
Old October 1st, 2009, 03:13 PM
adderek adderek is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 2 adderek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 2 sec
Reputation Power: 0
Stupid idea

Why you want to block users from right-click? Maybe you would like to disable mouse and keyboard support as well?

I'm using gestures under right-click. I'm using right-click menu for navigation. When I find a page that forbids right-click I add it to blocked sites.
Some sites I really want to use - then I am fighting with scripts like that - by blocking the ability to block the right-click.

Does it add any security? I can easily copy any content from such webs. Install chrome or firefox or maxthon and then drag'n'drop the picture - works perfectly.
You can use browsers cache to get the picture. You can check the web's source to find the URL of the picture. You can use automatic-download-addons for browsers. There are more ways of copying the images.

Again: Why do you want to make the user crippled?
If you are reading this and going to use such script - knock yourself in your head and think again if that is what you want to do. If you really do then use huge flash animation instead of web content and make it full screen. And add a horn sound. Maybe a virus as well.... Yes - that is something that some web developers would love to do - or at least it looks so.

Sorry for excessive criticism but the criticism is well earned in that case.

Reply With Quote
  #6  
Old October 12th, 2009, 10:31 PM
sangramanand sangramanand is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 2 sangramanand User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 52 sec
Reputation Power: 0
thank you very much for the javascript... i was badly in search of this ocde which works on both firefox and IE.... thanx once again

Reply With Quote
  #7  
Old October 12th, 2009, 10:35 PM
sangramanand sangramanand is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 2 sangramanand User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 52 sec
Reputation Power: 0
i agree wid ur point adderek, there are many toolz and techniques that we can use to capture the image... but some websites basically official sites have to disable rightclick to some pages to meet the basic company requirements, so such codes will be very helpful for the webdesigners in order to fulfill the organisations requirement.....

Reply With Quote
  #8  
Old October 13th, 2009, 03:53 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 1,029 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 1690497 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1690497 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1690497 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1690497 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1690497 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1690497 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1690497 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1690497 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1690497 Folding Title: Super Ultimate Folder - Level 4
Time spent in forums: 1 Week 3 h 49 m 58 sec
Reputation Power: 7
Send a message via ICQ to Itsacon
Such developers should spend more time educating their superiors, as these techniques only give the pretense of security.

This thread has been necro'd enough, I'm locking it.
__________________
This is my code. Is it not nifty?

"The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools."
---Douglas Adams


Join the Itsacon fanclub!    
Zero Tolerance: Spammers banned so far: 443

Reply With Quote
Closed Thread

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Javascript to disable right-click on Mozilla Firefox & Internet Explorer


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek