473,395 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.

Mar 1 '07 #1
10 3312
On Mar 1, 10:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
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

Mar 1 '07 #2
On Mar 1, 7:57 am, "RobG" <r...@iinet.net.auwrote:
On Mar 1, 10:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
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).

Mar 1 '07 #3
Tom Cole wrote on 01 mrt 2007 in comp.lang.javascript:
On Mar 1, 7:57 am, "RobG" <r...@iinet.net.auwrote:
>On Mar 1, 10:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
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)
Mar 1 '07 #4
On Mar 1, 9:09 am, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
Tom Cole wrote on 01 mrt 2007 in comp.lang.javascript:


On Mar 1, 7:57 am, "RobG" <r...@iinet.net.auwrote:
On Mar 1, 10:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
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)- Hide quoted text -

- Show quoted text -
the only full proof way is to make them images

Mar 1 '07 #5
plemon said the following on 3/1/2007 1:34 PM:

<snip>
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/
Mar 1 '07 #6
Randy Webb wrote on 01 mrt 2007 in comp.lang.javascript:
plemon said the following on 3/1/2007 1:34 PM:

<snip>
>the only full proof way is to make them images
"fool" proof?

Kings II 17:10: "And they made 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.
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)
Mar 2 '07 #7
dd
On Mar 1, 1:50 pm, "Sillu" <madhotra.su...@gmail.comwrote:
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.

Mar 2 '07 #8
Evertjan. said the following on 3/2/2007 3:19 AM:
Randy Webb wrote on 01 mrt 2007 in comp.lang.javascript:
>plemon said the following on 3/1/2007 1:34 PM:

<snip>
>>the only full proof way is to make them images

"fool" proof?

Kings II 17:10: "And they made 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.

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/
Mar 2 '07 #9
"Sillu" <ma************@gmail.comwrote in news:1172753406.720298.46880
@v33g2000cwv.googlegroups.com:
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");
}

Mar 3 '07 #10
Jim Land wrote:
<snip>
[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.
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.

Mar 3 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Vik Rubenfeld | last post by:
(Disclaimer: I know nothing about Javascript). As many here probably know, there's a web service called Furl that lets you copy the text of a site and store it for later search and retrieval. ...
3
by: cv | last post by:
Hi all, I have to copy two set of data from 2 files(notepad/excel) say, products and their corresponding prices to list/textarea/table. I should be able to retrieve the product and corresponding...
2
by: dot | last post by:
I'm trying to use some code I found here - http://javascript.internet.com/navigation/click-to-expand-menu.html When I open this page in my browser (Firefox at the moment), the click-expand menu...
0
by: Tess | last post by:
Hi, Long time reader, first time poster... Any help is appreciated. I have a few questions regarding Winform controls embedded within an html page. For more info please see the appendix. Now,...
5
by: Dave Vick | last post by:
OK, I've got a requirment to copy some content from an HTML page. It is a failry lengthy page and we want to give the user/reader the ability to click a button and have a section of the page copied...
2
by: Clodoaldo Pinto Neto | last post by:
Hi all, I'm trying to copy a table with a text field column containing a new line char to a file: ksDesenv=# create table page(line text) without oids; CREATE TABLE ksDesenv=# insert into...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
0
by: sajithkahawatta | last post by:
i am new to asp. i want this,it should possible to copy text line from somewhere (like word doc with text format).and paste it on the asp page(in a text area or somewhere). then code to get it from...
0
by: Keith G Hicks | last post by:
asp.net 2.0 Well until I started looking for how to do this I figured it would be very easy and lots of information out there. Maybe I'm not looking in the right places. I have some code in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.