Skip to content
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

Better clipboard paste error handling on Chrome for cross-origin iframes #9072

Closed
vmiklos opened this issue May 16, 2024 · 1 comment
Closed
Assignees
Labels
24.04 bug Something isn't working unconfirmed

Comments

@vmiklos
Copy link
Contributor

vmiklos commented May 16, 2024

Describe the Bug

23.05 used to have suboptimal copy, but it did work to some extent. Now if an integration is not updated to allow clipboard write for cross-origin iframes, copy doesn't work at all on 24.04.

Steps to Reproduce

  1. Open e.g. a Writer document in COOL, in a setup where COOL and the integration is served from different domains. E.g. nextcloud with its richdocuments.git, stable28 branch, with commit 6e29846aeda3bb933935400bb7334a3a71445211 reverted. But Clipboard access issue owncloud/richdocuments#545 is probably a similar environment.
  2. Select some text.
  3. Press 'copy' on the notebookbar.

Expected Behavior

If the integration doesn't allow new-style copy, a popup should appear encouraging the user to try again via the keyboard. We should also remember that new-style copy failed and not try again.

Actual Behavior

An error is logged on the JS dev console, but otherwise nothing.

Desktop

Tested on Chrome, with old enough (see above) Nextcloud integration, COOL and Nextcloud served from different domains.

Additional Context

An alternative would be to just remember the failure for the duration of the edit session (global JS variable). That would have the benefit that in case the integration gets fixed, new-style copy gets a chance again in the next edit session. The cost would be that every time the first copy would be broken. Seems the cost outweights the benefit, so for now we save a setting and never try again, even not after a browser reload.

@vmiklos
Copy link
Contributor Author

vmiklos commented May 21, 2024

The above PR fixes this for me.

@vmiklos vmiklos closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
24.04 bug Something isn't working unconfirmed
Projects
Archived in project
Development

No branches or pull requests

1 participant