防止从网站复制文本 [英] preventing text copy from a website

查看:110
本文介绍了防止从网站复制文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.
有没有办法防止从我的网站复制文本?
我知道有些脚本可以右键单击和复制,但是如果在浏览器中禁用了脚本,可以将其覆盖.

是否有某种智能"方式甚至隐藏一些一旦复制就将被更改为该文本的文本?

还有其他想法吗?

谢谢
Orit

Hello.
Is there a way to prevent copying a text from my website?
I know there are some scripts that pervent right clicking and copying, but it can be overriden if in the browser they disable scripts.

Is there some "smart" way to maybe even hide some text that once copied, will be changed to that text?

Any other ideas?

Thank you,
Orit

推荐答案

您可以使用Flash,Silverlight或Java渲染网页,如果操作正确,将阻止用户选择文本.

或者,您可以将所有文本以混杂字符串的形式存储在javascript中,然后可以使用CSS以适当的顺序将其放置在整个页面中.如果每个字符都完全基于单个位置放置,则不确定任何浏览器是否都可以整理出正确的文本顺序.

如果您的网页是静态的(即没有文本框或类似的内容),则可以在服务器端渲染该网页,然后将仅作为该网页的屏幕快照的图像提供给客户端.

您可以使用此JavaScript库将文本呈现为一堆彩色的DIV.没有浏览器将DIV转换为文本.

您可以将页面上使用的每个字符(a-z,0-9,标点符号等)呈现为一堆小图像.然后,您可以将文本显示为彼此相邻的一堆图像,而不是彼此相邻的一堆字符.这样做的好处是,在调整页面大小时,它将正确调整布局,就像图像是文本一样.同样,JavaScript可用于自动执行此过程.

同样,用户有时可以通过查看HTML源代码到页面并将文本复制到其中来破坏您的技术.您可以通过以下方法来防止出现这种情况:将一个非常空白的网页然后异步调用您的网站以获取内容.并且有一些工具可以使您的JavaScript模糊化,从而使任何人抓取您的内容都变得非常烦人.

取决于您是否真正关心阻止人们复制您网站上的内容.如果他们确实想要,他们可以在查看您的网站时在记事本中键入内容.对于图像,它们可以截图并粘贴到新窗口中.如果您真的想保护自己的内容,最好的方法就是根本不显示它.
You could render your webpage using Flash, Silverlight, or Java, which if done right would prevent the user from selecting text.

Or you could store all text in jumbled strings in your javascript, then you could place them throughout the page in the proper order using CSS. Not sure any browser would be capable of sorting out the correct order of the text if each character is absolutely positioned on an individual basis.

If your webpage is static (i.e., no textboxes or anything like that), you could render the webpage on the server side and serve up an image to the client that is just a screenshot of the webpage.

You could render the text as a bunch of colored DIVs using this JavaScript library. No browser is going to be able to convert DIVs into text.

You could render each character used on your page (a-z, 0-9, punctuation, etc.) as a bunch of small images. Then, you could present text as a bunch of images next to each other rather than a bunch of characters next to each other. The advantage of this is that when the page is resized, it would adjust the layout correctly just as if the images were text. Again, JavaScript could be used to automate this process.

Also, users can sometimes subvert your techniques by viewing the HTML source to a page and copying the text out of there. You can prevent this by having a pretty much blank webpage then asynchronously calling back to your website to get the content. And there are tools to obfuscate your JavaScript to make it really really annoying for anybody to grab your content.

Depends on how much you really care about preventing people from copying content from your website. If they really want, they can just type out the content in notepad while viewing your website. And in the case of images, they can just screenshot and paste into a new window. If you really want to protect your content, the best way would be to not show it at all.


非常感谢您的回答.
我不在乎他们是否坐下来并将其复制到记事本中.如果对他们来说太难了,我相信他们会放弃的.
我只是不希望对他们来说太简单.

关于此解决方案:
您可以使用此JavaScript库将文本呈现为一堆彩色的DIV.没有浏览器能够将DIV转换为文本.

您可以将页面上使用的每个字符(a-z,0-9,标点符号等)呈现为一堆小图像.然后,您可以将文本显示为彼此相邻的一堆图像,而不是彼此相邻的一堆字符.这样做的好处是,在调整页面大小时,它将正确调整布局,就像图像是文本一样.同样,JavaScript可用于自动执行此过程."

文字仍可被搜索引擎阅读吗?我的意思是,如果有人为我输入为图像"或div的文本中使用的某些关键词进行搜索,我的文本是否会显示在搜索结果中?我显然希望如此.

顺便说一句,您知道用于防止复制和右键单击的最佳免费脚本是什么?
我想也许只是使用它们,希望他们不会尝试太多.
我记得还曾见过一些网站甚至不让您标记和选择文本.
再次感谢.非常感谢您的帮助,
Orit.
Thank you very much for your answer.
I don''t care if they sit and copy it to notepad. If it will be too hard for them to do, I believe they will give up.
I just don''t want it to be too easy for them.

About this solution:
"You could render the text as a bunch of colored DIVs using this JavaScript library. No browser is going to be able to convert DIVs into text.

You could render each character used on your page (a-z, 0-9, punctuation, etc.) as a bunch of small images. Then, you could present text as a bunch of images next to each other rather than a bunch of characters next to each other. The advantage of this is that when the page is resized, it would adjust the layout correctly just as if the images were text. Again, JavaScript could be used to automate this process"

Will the text still be readable by search engines? I mean, if someone seraches for some keywords used in the text I put in as "images" or divs, will my text be shown in the search results? I obviously want it to be.

By the way, what is the best free script you know for preventing copy and right clicking?
I''m thinking of maybe just using that with the hope that they won''t try much.
I remember also seeing some websites that didn''t even let you mark and select text.
thanks again. I really appreciate your help,
Orit.


您应该能够轻松找到一些JavaScript,以防止通过Googling进行文本选择.例如,我用Google搜索"
另外,如果搜索引擎可以找到它,那么用户也可以找到它.我描述的大多数技术都会阻止搜索引擎找到您的内容.
You should be able to easily find some JavaScript to prevent text selection and such by Googling. For example, I googled for "javascript prevent text selection" and the first result was this useful page. Also, if you type "javascript prevent" into the Google search box, an auto-suggest list will popup with common things people try to prevent using JavaScript (image copying, text selection, and so on). Select any of those and complete the search and I''m sure you''ll find what you''re looking for.

Also, if a search engine can find it, a user can find it. Most of the techniques I described would prevent a search engine from finding your content.


这篇关于防止从网站复制文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆