-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chrome-based browser is blocking clipboard #50
Comments
This is due to Chrome's new(?) cross-domain iframe permissions, which it doesn't grant to our extension. I've tried using the permissions API locally to test whether we can request permission, but I haven't had much success. We'll probably have to add a text-based "copy text" fallback like on mobile. In the mean time, you'll need to use another browser instead. |
Related: w3c/webappsec-permissions-policy#322 In the long-term we'll have to ask Twitch to enable this, but for now a workaround is probably the best. It seems like this changed behaviour was actually unintentional on Chrome/Blink's side for now and they're working on reverting it. |
What happened here is that Chrome implemented a new permission system for clipboard, in the name of web security (great!). This means that browser will be able to better negotiate clipboard-permissions with the website, like disallowing non-interactive clipboard access, or requiring the user to accept a prompt for the website to access their clipboard. We should totally do that. Additionally Chrome has now put cross-origin clipboard access behind a feature policy, in order to protect users of the top-level site. This affects us because our extension is embedded in an iframe in Twitch through a cross-origin domain. Unfortunately they forgot to actually fully implement this feature policy, meaning that we (or even Twitch for that matter) cannot grant the feature policy to the extension's iframe (bad!). This is being worked on. So for our extension, I think we want the following approach:
At this time we're just writing to the clipboard to allow the browser to prompt the user. If the clipboard call fails, we fall back to a textarea and allow the user to copy manually. This should make the extension tolerant to the various browser-behaviours, and should silently revert back from the text-based fallback to the onclick behaviour once 1) Twitch adds In order to get Twitch to add the |
The Chromium change is making progress. Looks like the feature policy has now been split up into |
Fallback has been added in ceef05a, waiting for Twitch approval. |
1.0.1 with the fallback is live on Twitch. Keeping this issue open to track Chrome and Twitch implementing the feature policy. |
Regarding the Chrome bug, a fix is now merged to Chrome M85+. Feature policies |
Great, thank you! |
As a funny twinkle to all of this, we've now discovered that the This all feels a bit backwards, but would be a temporary measure for us until Twitch finally adds this attribute to their whitelist. |
We're happy with the current solution and don't necessarily need to wait for Twitch to whitelist those permission properties. |
click copy button will now raise exception:
The text was updated successfully, but these errors were encountered: