一个人怎么可以检测复制在浏览器中的链接? [英] How can one detect copying a link in a browser?
问题描述
昨天,我曾与一名出租车司机,并在提的是,我是一个程序员,他告诉我说,几天前,他曾经历了以下几个聊天:在试图将URL从他的浏览器的地址栏复制,一个消息框出现像的请不要复制此链接,而注册的
Yesterday I had a chat with a taxi driver and upon mentioning that I am a programmer, he told me that a couple of days earlier he had experienced the following: upon trying to copy the URL from the address bar of his browser, a messagebox appeared with a message like "Please don't copy this link, rather register".
我不是一个web开发人员,所以这可能是一个蹩脚的问题:-)但我不知道如何这样的事情是完成的?什么技术或语言给人一种这个水平的控制权事件在浏览器中?
I am not a web developer, so this might be a lame question :-) but I wonder how such a thing is accomplished? What technology or language gives one this level of control over the events within the browser?
该网站是某种电影下载服务的,据我的理解。我没有问他用什么浏览器,但他的平台是WinXP的所以大部分可能是IE浏览器。因为我没有实现此功能的技术的想法,我不能添加任何技术特定的标签,但如果你知道一个适当的,随意添加它。
The site was some sort of a movie downloading service, as far as I understood. I failed to ask him what browser he used, but his platform was WinXP so most probably it was IE. Since I have no idea of the technology implementing this feature, I can't add any technology specific tags, but if you know an appropriate one, feel free to add it.
在阅读的答案,最似乎收敛于认为
Upon reading the answers, most seem to converge on the opinion that
- 在浏览器页面上是相当容易实现,但
- 地址栏上没有,如果有可能的话。
我特意问回,以确保他的意思,他被复制从地址栏中的网址,他证实。尽管如此,它仍可能是两边的误解。我还没有看到的情况下发生的,从而为我听到它,我只能重复其描述。
I specifically asked back to make sure that he meant he was copying the URL from the address bar, and he confirmed that. Nevertheless, it might still be a misunderstanding on either side. I haven't seen the event happening, so I can only repeat its description as I heard it.
推荐答案
这曾经是可能的IE7和旧版本的Flash 10。
This used to be possible with IE7 and older versions of Flash 10.
在IE7(8我认为),你可以简单的:
In IE7 (and 8 I think), you can simply:
var vulnerability = window.clipboardData.getData("Text");
这是一个漏洞,并在IE9是默认不允许的。在Firefox挂钩到剪贴板接口也默认不允许的。在Safari /铬这不是在 onPaste
处理要么允许,除非明确。
This is a vulnerability, and in IE9 is disallowed by default. In Firefox hooking into the Clipboard interface is also disallowed by default. In Safari/Chrome this not allowed either, EXCEPT explicitly in onPaste
handlers.
在Flash中,你可以简单地做 Clipboard.getData()
前几个月前。剪贴板现在已经在Flash中只写访问(但仍保留它在空气全部功能)。
In Flash, you could simply do Clipboard.getData()
prior to several months ago. The Clipboard now has write-only access in Flash (but still retains it's full capability in Air).
在IE浏览器,你可以看到琐碎会做的。只需拨打 window.clipboardData.getData(文本)
每隔几秒钟。使用Flash,它不会一直更难。只需简单勾一个Javascript功能到您的Flash视频和环路视频。
In IE, you can see how trivial this would be to do. Simply call window.clipboardData.getData("Text")
every couple of seconds. With Flash, it wouldn't have been much harder. Simply hook a Javascript function into your Flash video and loop the video.
在上述类型特设的方式访问剪贴板是$ P $上的所有主流浏览器psently不可能的。
Accessing the clipboard in the aforementioned type of ad hoc manner is presently impossible on all major browsers.
这篇关于一个人怎么可以检测复制在浏览器中的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!