In CKEditor you have paste
event of editor instance. It's much more reliable than native paste
because not every browser fires it in the same way (Opera doesn't that at all). Also, cool thing about CKEditor's paste event is that you can modify data that were pasted before they will be inserted into selection in document.
Here's documentation of this event: http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-paste
Note: New version of CKEditor has been released week ago and this event had been modified, so ensure that you're using CKEditor 4.
Example usage (you can get editor instance from e.g. CKEDITOR.instances
object or if you're using CKEDITOR.replace()/append()
then editor instance is returned by these methods):
editor.on( 'paste', function( evt ) {
var data = evt.data;
data.dataValue = data.dataValue.replace(
/(http:\/\/[^\s]+)/gi, '<a href="$1">$1</a>' );
// Text could be pasted, but you transformed it into HTML so update that.
data.type = 'html';
});