Open Bug 1233162 Opened 9 years ago Updated 4 years ago

Allow clipboardData.clearData() and clipboardData.setData during onpaste event

Categories

(Core :: DOM: Events, enhancement, P5)

45 Branch
enhancement

Tracking

()

People

(Reporter: alex.neblett, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:46.0) Gecko/20100101 Firefox/46.0 Build ID: 20151216030229 Steps to reproduce: 1. Got RTF of the clipboard during an onpaste event (clipboardData.getData('text/rtf')) 2. Converted the rtf into custom html. 3. Tried to clear the clipboard (clipboardData.clearData()). 4. Tried to put html on the clipboard (clipboardData.setData('text/html', clipboardHtml)). Actual results: NoModificationAllowedError: Modifications are not allowed for this document Expected results: I wanted to clear the clipboard and put custom html made from the RTF on it so that the custom html would paste into contenteditable html. If you look at Bug 938991 - text/rtf support for clipboard data, it opens up nice opportunities, but without allowing clearData and setData during the onpaste event, the user experience becomes complicated with extra steps (1 -paste gets rtf and converts to html, 2 - copy to clear clipboard and put custom html on it, 3 - paste the custom html). Thanks, Alex
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true

Bulk-downgrade of unassigned, untouched DOM/Storage bug's priority.

If you have reason to believe, this is wrong, please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5

How do I upvote this? Note this seems to work it just generates the error. I need to be able to sanitize the html if the user's clipboard contains it before it is applied to my document.

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