How can one detect copying a link in a browser?

后端 未结 4 2263
自闭症患者
自闭症患者 2021-02-14 04:53

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 c

4条回答
  •  再見小時候
    2021-02-14 05:46

    This used to be possible with IE7 and older versions of Flash 10.

    In IE7 (and 8 I think), you can simply:

    var vulnerability = window.clipboardData.getData("Text");
    

    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.

    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).

    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.

    Accessing the clipboard in the aforementioned type of ad hoc manner is presently impossible on all major browsers.

提交回复
热议问题