Bug 22017 - Access to clipboardData.getData and setData blocked in oncopy
: Access to clipboardData.getData and setData blocked in oncopy
Status: UNCONFIRMED
: WebKit
JavaScriptCore
: 525.x (Safari 3.1)
: PC Windows XP
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-10-31 14:55 PST by
Modified: 2008-10-31 16:29 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-10-31 14:55:57 PST
function copyEvent(evt) {
evt.clipboardData.getData('Text'); //undefined
}

document.addEventListener('copy',copyEvent, true);


Access to the clipboard, set and get should be allowed within oncopy and onpaste.

Data in the clipboard that the user is trying to copy should already be on the clipboard during the execution of oncopy, or there should be an onaftercopy function.

Relevance:

Building in browser code editing software and safari incorrectly copies new line characters entered by the user inside a contentEditable=true / designMode=true element.

Ability to replace \r with \r\n is required in order to fix this issue on windows machines.
------- Comment #1 From 2008-10-31 16:29:46 PST -------
Note: The use isn't only for replacing the new line character. However I did find a way to work around my particular issue.

Access to these copy/paste functions are fairly important in-case there ends up being a problem with the way the browser is responding and the application needs to correct it.

Thank you.