Microsoft/vscode
GitHub で見るClipboard access is blocked when not via a user gesture
Open
#184,326 opened on 2023年6月5日
bughelp wantedlive-previewpapercut :drop_of_blood:regressionwebview
Repository metrics
- Stars
- (74,848 stars)
- PR merge metrics
- (平均マージ 11h 43m) (30d で 1,000 merged PRs)
説明
Recently VS Code changed webview behavior to require a user gesture to access the clipboard. The import from clipboard command in Luna Paint broke due to this as the navigator.clipboard access cannot be mapped to the user gesture of running the command. This is how I edit screenshots so I end up using this command multiple times a day.
I looked into fixing this and I don't think I can. I figured I could just read the clipboard on the exthost, but we only seem to support readText on env.clipboard.
Can we either:
- Change the behavior such that the user gesture requirement is not needed? A VS Code extension is not a typical website and should not require these user gesture security requirements.
- Add an equivalent to
navigator.clipboard.readwhich contains a list of clipboard items with multiple mime types.
Then could we add a regression test as I think this is the 3rd or 4th time clipboard access has broken in webviews.