Open Tyriar opened 3 years ago
@Tyriar I just tested this in Chrome on GitHub.dev
using an extension with creates a webview that runs:
setInterval(async () => {
try {
const c = await navigator.clipboard.readText();
console.log(c)
} catch (e) {
console.error(e);
}
}, 1000);
This fails if the webview is not focused but works properly when the document is focused
@Tyriar Are you still running into this? If so, can you share more details about how to reproduce
Codespaces had blocked SharedArrayBuffer
due to not including the needed headers, I haven't used Luna Paint in it for a month or so so not sure
@Tyriar Did you get a chance to test this now that Luna Paint is running on web?
Can't test yet as I get a CSP problem when I try to load in github.dev/codespaces
Refused to connect to 'https://....loca.lt/package.json' because it violates the following Content Security Policy directive: "connect-src 'self'
Need to publish first
Got it working by installing the vsix, both copy and paste don't work in codespaces and there are no errors in the console when I do them.
It would be nice to get some testing around clipboard access in custom webviews as it's broken several times now
What browser are you using? A minimal example works fine for me in chrome.
However on safari I see:
The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission
There is never a visible prompt so I'm not sure what safari needs here
This was in latest Edge on Windows
Right now using
navigator.clipboard
gets rejected inside a webview editor in a Codespace.