microsoft / microsoft/monaco-editor
[Bug] Safari: non-https site reports `undefined is not an object (evaluating 'navigator.clipboard.write')`
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
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.writetriggers the bug
installWebKitWriteTextWorkaround() {
const handler = () => {
....
navigator.clipboard.write([new ClipboardItem({ // !!!!!!!!!!!!!! BUG HERE !!!!!!!!!!!!!!!!!!!!!
'text/plain': currentWritePromise.p,
})])
....
};
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at installWebKitWriteTextWorkaround() and reproduce the reported behavior in Safari on a non-HTTPS local-IP site using Monaco Editor v0.48.0. Trace the navigator.clipboard.write call and verify the completed change no longer reports the undefined-object error when clipboard handling is triggered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100