no one can login to my website with mozilla

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
usmivkata
Guest

no one can login to my website with mozilla

Post by usmivkata »

Hi,
when I use java script to protect my website text and images from being copied the fields for username and password in Mozilla become unwritable and no one can login. The other browsers are working without problems. Do you have any idea how to solve the problem?

Here is the script. I am not using it now on the website because of the login problems, but it is a joomla site. I hope this information helps.

Thanks in advance!


<script>

//Disable select-text script (IE4+, NS6+)

function disableselect(e){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function ("return false")

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
User avatar
SK.
Moderator
Posts: 20814
Joined: October 18th, 2007, 1:28 pm
Location: Third Rock From The Sun
Contact:

Post by SK. »

This thread belongs in the Web Development / Standards Evangelism forum. However, you need to be registered to post there. Please register, return to this thread to let us know and we can move this thread to the appropriate forum. Please do not cross-post.
John 3:16 and Philippians 4:13
usmivkata
Posts: 8
Joined: November 12th, 2007, 1:51 pm

Post by usmivkata »

Would you please move it now :-)
User avatar
SK.
Moderator
Posts: 20814
Joined: October 18th, 2007, 1:28 pm
Location: Third Rock From The Sun
Contact:

Post by SK. »

Someone already took care of it for us. :)
John 3:16 and Philippians 4:13
User avatar
Omega X
Posts: 8225
Joined: October 18th, 2007, 2:38 pm
Location: A Parallel Dimension...

Post by Omega X »

Small Note, Javascript cannot fully protect text and images from being copied. If it can be seen it can be copied.
usmivkata
Posts: 8
Joined: November 12th, 2007, 1:51 pm

Post by usmivkata »

I know that, but it is better then nothing. If you have better ideas you are welcome.
User avatar
jscher2000
Posts: 11763
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Post by jscher2000 »

To exclude form fields from your script, try this:

Code: Select all

function disableselect(e){
  if (e.target.tagName != "INPUT") return false;
}

Note that IE uses windows.event.srcElement rather than e.target, but it appears you are not targeting IE with this method so I've ignored that for present purposes.
usmivkata
Posts: 8
Joined: November 12th, 2007, 1:51 pm

Post by usmivkata »

Great thanks! Works perfect!
usmivkata
Posts: 8
Joined: November 12th, 2007, 1:51 pm

Post by usmivkata »

The same script prints blank sheet on IE is it possible this also to be done for Mozilla?
User avatar
np
Posts: 301
Joined: October 18th, 2007, 6:31 pm
Location: Winnipeg
Contact:

Post by np »

Just add a print stylesheet of

Code: Select all

body { display: none;}
usmivkata
Posts: 8
Joined: November 12th, 2007, 1:51 pm

Post by usmivkata »

np wrote:Just add a print stylesheet of

Code: Select all

body { display: none;}


May be I can't do something right, but looks like it does not work. Any ideas how to add also ctrl+a and ctrl+c copying?
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Post by Anonymosity »

As far as images go, someone can still capture a screenshot of the browser window.
User avatar
jscher2000
Posts: 11763
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Post by jscher2000 »

usmivkata wrote:
np wrote:Just add a print stylesheet of

Code: Select all

body { display: none;}


May be I can't do something right, but looks like it does not work.

The suggestion is to create a new .css file (e.g., print.css) and add a new <link> tag to your document specifying that the browser should use print.css for media="print". For more information:

http://www.tufts.edu/webcentral/tutorials/printcss/
http://meyerweb.com/eric/articles/webrev/200001.html

usmivkata wrote:Any ideas how to add also ctrl+a and ctrl+c copying?

Not sure exactly what this means. You want to intercept these keystrokes and discard them? You can look at the script for this photo slide show for an example of how to capture key events for Firefox and IE:

http://jeffersonscher.com/thailand2005/food/
http://jeffersonscher.com/thailand2005/food/photoview.js

You would need to add detection for the Ctrl key. This article should help:

http://developer.mozilla.org/en/docs/DOM:event.ctrlKey
Last edited by jscher2000 on February 21st, 2010, 8:25 pm, edited 1 time in total.
usmivkata
Posts: 8
Joined: November 12th, 2007, 1:51 pm

desable ctrl+a and ctrl+c on website

Post by usmivkata »

Sorry I could not explain it better. Actually I wanted to disable cthrl+a and ctrl+c functions in order to protect text and images from being copied.
In joomla based websites I do not think it is possible to add additional css file, so I have to add java script directly into the code.
Mordwin
Posts: 653
Joined: June 8th, 2005, 6:10 am

Post by Mordwin »

Rather a pointless exercise then as in viewing your website I've *already* copied it...
Post Reply