Revise the prefs for clipboard API
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox102 | --- | fixed |
People
(Reporter: edgar, Assigned: edgar)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Currently, dom.events.asyncClipboard.clipboardItem
is used to control Clipboard.write
and also ClipboardItem
interface, and dom.events.asyncClipboard.read
is used to control Clipboard.read
only.
But exposing Clipboard.read
will also need to expose ClipboardItem
interface. And we plan to work on Clipboard.read
first.
So in this bug, I would like to
- Make
dom.events.asyncClipboard.read
controls bothClipboard.read
andClipboardItem
interface. - Rename
dom.events.asyncClipboard.clipboardItem
todom.events.asyncClipboard.write
and make it only controlsClipboard.write()
.
In my opinion we should only expose ClipboardItem
together with Clipboard.write
. Clipboard.read
will work even without exposing ClipboardItem
directly.
Assignee | ||
Comment 2•3 years ago
|
||
But Clipboard.read do return a ClipboardItem instance, but there is no ClipboardItem
interface exposed, which is not trivial. We could hide the constructor for Clipboard.write
. WDYT?
But Clipboard.read do return a ClipboardItem instance, but there is no ClipboardItem interface exposed, which is not trivial.
I am not sure what you mean "is not trivial". Only partially exposing these features is of course far from ideal, but I think exposing ClipboardItem and not clipboard.write will lead to compatibility issues. When you say hide the constructor, would that mean "window.ClipboardItem" doesn't exist?
Assignee | ||
Comment 4•3 years ago
|
||
(In reply to Tom Schuster [:evilpie] from comment #3)
When you say hide the constructor, would that mean "window.ClipboardItem" doesn't exist?
I mean https://searchfox.org/mozilla-central/rev/86c98c486f03b598d0f80356b69163fd400ec8aa/dom/webidl/Clipboard.webidl#36-38 doesn't exist.
Note that once someone calls clipboard.read()
, window.ClipboardItem
will also be defined, I think it might because we create a ClipboardItem instance.
Assignee | ||
Comment 5•3 years ago
|
||
(In reply to Tom Schuster [:evilpie] from comment #3)
I think exposing ClipboardItem and not clipboard.write will lead to compatibility issues.
Could you elaborate why?
Because I think it's quite likely that code (like this) will assume that when ClipboardItem is available then clipboard.write is also available.
Assignee | ||
Comment 7•3 years ago
|
||
Okay, thanks. So give that there is already an example for that, then I think we should expose them all together.
Assignee | ||
Comment 8•3 years ago
|
||
Comment 10•3 years ago
|
||
bugherder |
Description
•