Clipboard access is blocked when not via a user gesture
#184.326 aberto em 5 de jun. de 2023
Métricas do repositório
- Stars
- (74.848 stars)
- Métricas de merge de PR
- (Mesclagem média 11h 43m) (1.000 fundiu PRs em 30d)
Description
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.