microsoft / microsoft/monaco-editor

[Bug] Safari: non-https site reports `undefined is not an object (evaluating 'navigator.clipboard.write')`

Open
#4,496 3 comments 8 reactions 0 assignees View on GitHub

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.write triggers the bug
    installWebKitWriteTextWorkaround() {
        const handler = () => {
            ....
            navigator.clipboard.write([new ClipboardItem({ // !!!!!!!!!!!!!! BUG HERE !!!!!!!!!!!!!!!!!!!!!
                    'text/plain': currentWritePromise.p,
                })])
            ....
        };

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.