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

fix(files_sharing): Fallback to old style clipboard copy for internal links #45593

Closed
wants to merge 2 commits into from

Conversation

joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented May 30, 2024

Summary

TODO

  • ...

Checklist

@joshtrichards
Copy link
Member Author

/compile amend /

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@nextcloud-command nextcloud-command force-pushed the jtr/fix-40666-fallback-copy branch from 831a7a9 to da793b5 Compare May 30, 2024 19:35
if (window.isSecureContext) {
await navigator.clipboard.writeText(this.internalLink)
} else { // nothing to lose by trying the fallback
document.execCommand('copy')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the link selected in this case?

(Another fallback would be window.prompt(t('Please copy the link manually'), this.internalLink))

@susnux
Copy link
Contributor

susnux commented May 31, 2024

Correct commit scope would be fix(files_sharing)

This comment was marked as outdated.

@solracsf solracsf added this to the Nextcloud 30 milestone Jun 18, 2024
@joshtrichards joshtrichards changed the title fix(files): Fallback to old style clipboard copy for internal links fix(files_sharing): Fallback to old style clipboard copy for internal links Jul 5, 2024
@joshtrichards
Copy link
Member Author

/compile amend /

@joshtrichards joshtrichards added the 2. developing Work in progress label Jul 5, 2024
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@nextcloud-command nextcloud-command force-pushed the jtr/fix-40666-fallback-copy branch from 6a5aabf to 7a5e967 Compare July 5, 2024 13:50
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
@erentar
Copy link

erentar commented Oct 10, 2024

How can I compile nextcloud with this fix?

@@ -93,7 +93,14 @@ export default {
methods: {
async copyLink() {
try {
await navigator.clipboard.writeText(this.internalLink)
if (window.isSecureContext) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be needed as this throws if not available.
So all it takes: in the catch block add a window promt.

@joshtrichards
Copy link
Member Author

Closing. Replaced by #49141

@st3iny st3iny deleted the jtr/fix-40666-fallback-copy branch November 8, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: No clipboard access for non-https NextCloud servers
5 participants