Bug 22017 - Access to clipboardData.getData and setData blocked in oncopy
: Access to clipboardData.getData and setData blocked in oncopy
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore
: 525.x (Safari 3.1)
: PC Windows XP
: P2 Normal
Assigned To: Nobody
Depends on:
  Show dependency treegraph
Reported: 2008-10-31 14:55 PDT by brad
Modified: 2008-10-31 16:29 PDT (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description brad 2008-10-31 14:55:57 PDT
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.


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 brad 2008-10-31 16:29:46 PDT
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.