-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update and stablize the Clipboard API #3992
Conversation
Promise<undefined> writeText(DOMString data); | ||
}; | ||
|
||
dictionary ClipboardUnsanitizedFormats { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if I should remove this, because it's Chrome-only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally tend to follow the spec regardless of browser support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a special case, because this API was merged without consensus, but I don't want to relitigate this here 🫠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets leave this part as unstable for sure then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe we can stabilize this just yet. Not only is the spec still in draft, but the repo seems quite active as well. I couldn't find any usage data as well.
Do you have any more hints to this API not changing anymore? Preferably usage data, which usually prevents any breaking changes to the API.
The base API for this is shipping in all three major engines, so I don't see how the current API could change. |
Unfortunately this happens regularly and then we end up stuck with outdated APIs that we can't really fix without a breaking change. Though I agree that the base API is unlikely to change any further, so what we can do is stabilize parts of it we are more certain then not aren't going to change. Let me know if you need any help with that! |
I've removed (commented out) everything that isn't supported by Chrome, Firefox and Safari currently. |
# [wasm_bindgen (static_method_of = ClipboardItem , js_class = "ClipboardItem" , js_name = supports)] | ||
#[doc = "The `supports()` method."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/supports)"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That link seems to be broken, shouldn't it be https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/supports_static ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link is generated, so that would have to be fixed in the generator.
It would be interesting to see if that is an exception for this specific static method or if this actually fixes a bug in the generator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #4010.
Fixes #3991.