Connecting Tech Pros Worldwide Help | Site Map

Not to copy text from a web page

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 1st, 2007, 12:05 PM
Sillu
Guest
 
Posts: n/a
Default Not to copy text from a web page

I'ld like to create a web page, from which no one can select the text
simply, copy frm there n paste at another location. In simple means,
i'ld like to stop copy process from my web page. Plz suggest
JavaScript code for this purpose.


  #2  
Old March 1st, 2007, 12:05 PM
RobG
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

On Mar 1, 10:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
Quote:
I'ld like to create a web page, from which no one can select the text
simply, copy frm there n paste at another location. In simple means,
i'ld like to stop copy process from my web page. Plz suggest
JavaScript code for this purpose.
Impossible. The following FAQ items are in regard to script, but the
same holds for any other content in the page - if you publish it on
the web, it can be saved locally:

<URL: http://www.jibbering.com/faq/#FAQ4_1 >
<URL: http://www.jibbering.com/faq/#FAQ4_5 >

<FAQENTRY>
Perhaps the items on page protection can be rolled into one, and be in
regard to page content in general as well as just for script
</FAQENTRY>

--
Rob

  #3  
Old March 1st, 2007, 12:25 PM
Tom Cole
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

On Mar 1, 7:57 am, "RobG" <r...@iinet.net.auwrote:
Quote:
On Mar 1, 10:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
>
Quote:
I'ld like to create a web page, from which no one can select the text
simply, copy frm there n paste at another location. In simple means,
i'ld like to stop copy process from my web page. Plz suggest
JavaScript code for this purpose.
>
Impossible. The following FAQ items are in regard to script, but the
same holds for any other content in the page - if you publish it on
the web, it can be saved locally:
>
<URL:http://www.jibbering.com/faq/#FAQ4_1>
<URL:http://www.jibbering.com/faq/#FAQ4_5>
>
<FAQENTRY>
Perhaps the items on page protection can be rolled into one, and be in
regard to page content in general as well as just for script
</FAQENTRY>
>
--
Rob
Wouldn't it at least make it a lot more difficult if the body of a
document had only a single div element and the actual page contents
were retrieved through an Ajax call and appended to the div node? A
view source request would then only show the div (unless you had
something like the Firefox developer toolbar which will show generated
source).

  #4  
Old March 1st, 2007, 01:25 PM
Evertjan.
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

Tom Cole wrote on 01 mrt 2007 in comp.lang.javascript:
Quote:
On Mar 1, 7:57 am, "RobG" <r...@iinet.net.auwrote:
Quote:
>On Mar 1, 10:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
>>
Quote:
I'ld like to create a web page, from which no one can select the
text simply, copy frm there n paste at another location. In simple
means, i'ld like to stop copy process from my web page. Plz suggest
JavaScript code for this purpose.
>>
>Impossible. The following FAQ items are in regard to script, but the
>same holds for any other content in the page - if you publish it on
>the web, it can be saved locally:
>>
><URL:http://www.jibbering.com/faq/#FAQ4_1>
><URL:http://www.jibbering.com/faq/#FAQ4_5>
>>
><FAQENTRY>
>Perhaps the items on page protection can be rolled into one, and be
>in regard to page content in general as well as just for script
></FAQENTRY>
>>
>--
>Rob
>
Wouldn't it at least make it a lot more difficult if the body of a
document had only a single div element and the actual page contents
were retrieved through an Ajax call and appended to the div node? A
view source request would then only show the div (unless you had
something like the Firefox developer toolbar which will show generated
source).
Yes, if you were not able to type or copy in the IE address bar:

javascript:w=window.open('');w.document.write(docu ment.body.innerText);
void 0

[beware of linebreaks]

Please Tom and Sillu, accept what is known for years, that what you
publish on the web is available on the web, also for copying.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
  #5  
Old March 1st, 2007, 05:45 PM
plemon
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

On Mar 1, 9:09 am, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
Quote:
Tom Cole wrote on 01 mrt 2007 in comp.lang.javascript:
>
>
>
>
>
Quote:
On Mar 1, 7:57 am, "RobG" <r...@iinet.net.auwrote:
Quote:
On Mar 1, 10:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
>
Quote:
Quote:
I'ld like to create a web page, from which no one can select the
text simply, copy frm there n paste at another location. In simple
means, i'ld like to stop copy process from my web page. Plz suggest
JavaScript code for this purpose.
>
Quote:
Quote:
Impossible. The following FAQ items are in regard to script, but the
same holds for any other content in the page - if you publish it on
the web, it can be saved locally:
>
Quote:
Quote:
<URL:http://www.jibbering.com/faq/#FAQ4_1>
<URL:http://www.jibbering.com/faq/#FAQ4_5>
>
Quote:
Quote:
<FAQENTRY>
Perhaps the items on page protection can be rolled into one, and be
in regard to page content in general as well as just for script
</FAQENTRY>
>
Quote:
Quote:
--
Rob
>
Quote:
Wouldn't it at least make it a lot more difficult if the body of a
document had only a single div element and the actual page contents
were retrieved through an Ajax call and appended to the div node? A
view source request would then only show the div (unless you had
something like the Firefox developer toolbar which will show generated
source).
>
Yes, if you were not able to type or copy in the IE address bar:
>
javascript:w=window.open('');w.document.write(docu ment.body.innerText);
void 0
>
[beware of linebreaks]
>
Please Tom and Sillu, accept what is known for years, that what you
publish on the web is available on the web, also for copying.
>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)- Hide quoted text -
>
- Show quoted text -
the only full proof way is to make them images

  #6  
Old March 1st, 2007, 08:55 PM
Randy Webb
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

plemon said the following on 3/1/2007 1:34 PM:

<snip>
Quote:
the only full proof way is to make them images
Pure unadulterated garbage advice.
To prove your point, you are welcome to provide a test page as a proof
of concept and I will copy your text for you.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
  #7  
Old March 2nd, 2007, 07:25 AM
Evertjan.
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

Randy Webb wrote on 01 mrt 2007 in comp.lang.javascript:
Quote:
plemon said the following on 3/1/2007 1:34 PM:
>
<snip>
>
Quote:
>the only full proof way is to make them images
"fool" proof?

Kings II 17:10: "And they made them Images ..."
Quote:
Pure unadulterated garbage advice.
To prove your point, you are welcome to provide a test page as a proof
of concept and I will copy your text for you.
Even without going for a technical solution,
keyboards are cheap these days.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
  #8  
Old March 2nd, 2007, 09:15 AM
dd
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

On Mar 1, 1:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
Quote:
I'ld like to create a web page, from which no one can select the text
simply, copy frm there n paste at another location. In simple means,
i'ld like to stop copy process from my web page. Plz suggest
JavaScript code for this purpose.
You can't make it impossible. If it gets into your
browser as text (and not an image) then it's available
in so many ways (browser cache, view source, network
trace, file-save html page etc etc. So you really can't
prevent it in any fool-proof way. Even if you made it
an image, a basic graphics package can read it with an
OCR scan.

I have visited sites that do make attempts to stop
the simple users from doing it though. Some sites
try to catch the keypresses (control-C), or try to
detect attempts to highlight the text (capturing the
mouse drag events), or detecting the right-click
where people are trying to select "Copy".

It's probably not worth it though. The simple users
aren't going to do anything useful with your text.
The advanced users can get around whatever you do.

  #9  
Old March 2nd, 2007, 01:45 PM
Randy Webb
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

Evertjan. said the following on 3/2/2007 3:19 AM:
Quote:
Randy Webb wrote on 01 mrt 2007 in comp.lang.javascript:
>
Quote:
>plemon said the following on 3/1/2007 1:34 PM:
>>
><snip>
>>
Quote:
>>the only full proof way is to make them images
>
"fool" proof?
>
Kings II 17:10: "And they made them Images ..."
>
Quote:
>Pure unadulterated garbage advice.
>To prove your point, you are welcome to provide a test page as a proof
>of concept and I will copy your text for you.
>
Even without going for a technical solution,
keyboards are cheap these days.
>
Precisely :-)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
  #10  
Old March 3rd, 2007, 03:35 AM
Jim Land
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

"Sillu" <madhotra.sunil@gmail.comwrote in news:1172753406.720298.46880
@v33g2000cwv.googlegroups.com:
Quote:
I'ld like to create a web page, from which no one can select the text
simply, copy frm there n paste at another location. In simple means,
i'ld like to stop copy process from my web page. Plz suggest
JavaScript code for this purpose.
>
[Disclaimer: As others have pointed out, there is no way to absolutely
stop a user from copying the text from a page on the web.]

However, you just want to stop a user from using a mouse to select and
copy text on a web page. This is possible. Just make it impossible to
use the mouse to select text.

I ran across it here:
http://www.snopes.com/politics/soapbox/rooney4.asp
The text on that page is just ordinary text, but it can't be selected in
FF and IE.

Their method, simplified, looks like this:

if (typeof document.onselectstart!="undefined") {
document.onselectstart=new Function ("return false");
}else{
document.onmousedown=new Function ("return false");
document.onmouseup=new Function ("return true");
}

  #11  
Old March 3rd, 2007, 10:45 AM
Richard Cornford
Guest
 
Posts: n/a
Default Re: Not to copy text from a web page

Jim Land wrote:
<snip>
Quote:
[Disclaimer: As others have pointed out, there is no way to
absolutely stop a user from copying the text from a page on
the web.]
>
However, you just want to stop a user from using a mouse to
select and copy text on a web page. This is possible.
Just make it impossible to use the mouse to select text.
It is not possible to make it _impossible_ for the user to select text
and copy it.
Quote:
I ran across it here:
http://www.snopes.com/politics/soapbox/rooney4.asp
The text on that page is just ordinary text, but it can't
be selected in FF and IE.
>
Their method, simplified, looks like this:
>
if (typeof document.onselectstart!="undefined") {
document.onselectstart=new Function ("return false");
}else{
document.onmousedown=new Function ("return false");
document.onmouseup=new Function ("return true");
}
Apart from using a browser that allows javascript execution to be toggled
on and off with a keypress, a simple javascript URL will defeat that. For
IE, for example, a simple:-

javascript: void (document.onselectstart = null);

typed into the address/location bar followed by pressing the return key
will make it possible (even trivial) to select and copy text from the
browser (and that is without even considering acts such as pulling the
source files from the browser's cache and copying the text from those).

Richard.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.