beforecopy event
If you go to the Google Chrome developer tools th开发者_开发知识库en Scripts > Event Listener Breakpoints > Clipboard you will find the event beforecopy. Two questions:
1) What is it?
2) Why is it useful?
Occurs before the selection is copied to the clipboard and before the oncopy event.
- In Internet Explorer, the
onbeforecopy
event occurs on the deepest element in the DOM hierarchy that contains the entire selection.- In Google Chrome and Safari, the
onbeforecopy
event occurs on the deepest element in the DOM hierarchy that contains the start point of the selection.
The beforecopy
event is supported by Internet Explorer and WebKit browsers (Safari and Chrome).
http://help.dottoro.com/ljrlxaae.php and Wikipedia.
This is occurring before items are sent to the clipboard.
This is useful for sites that add their own footer, e.g. CNET adds the article at the end. Or places that want to transform the URL's. It just allows for more granular control.
精彩评论