[Bug] Safari: non-https site reports `undefined is not an object (evaluating 'navigator.clipboard.write')`
wxiaoguang opened this issue · comments
wxiaoguang commented
Reproduction Steps
- Use monaco-editor on a "http" site (v0.48.0), (do not use localhost, use local IP like
http://192.168.1.20
) - Use Safari to open the page, input anything
- Then
navigator.clipboard.write
triggers the bug
installWebKitWriteTextWorkaround() {
const handler = () => {
....
navigator.clipboard.write([new ClipboardItem({ // !!!!!!!!!!!!!! BUG HERE !!!!!!!!!!!!!!!!!!!!!
'text/plain': currentWritePromise.p,
})])
....
};