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

Add option to auto copy to clipboard #16

Open
corbindavenport opened this issue Sep 23, 2022 · 3 comments
Open

Add option to auto copy to clipboard #16

corbindavenport opened this issue Sep 23, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@corbindavenport
Copy link
Owner

Suggested here: https://twitter.com/LinkofHyrule89/status/1573131451054301185

Not all browsers support writing to the clipboard without a gesture (e.g clicking a button): w3c/clipboard-apis#182

Chromium will also soon require granting a permission before writing to the clipboard without a gesture: https://chromium.googlesource.com/chromium/src/+/10300ac7da93a7e322274f1e

Enabling the setting will probably require asking for a permission first, and only saving the setting if the permission is granted. There can also be a message above the share buttons that says if the result was successfully copied to the clipboard or not. Will need to test in Chrome Canary for future-proofing.

@corbindavenport corbindavenport added the enhancement New feature or request label Sep 23, 2022
@corbindavenport corbindavenport self-assigned this Sep 23, 2022
@vonDubenshire
Copy link

Man, what happened to Chrome's clipboard changes that they added in late 2019 until 2021?

I'm assuming some sort of security issue, because they allowed an icon in the share sheet after a copy function that you could then "send to a device" etc.

It vanished by summer 2021 as I only saw references to the development of unsanitized clipboard and the "pickling" functionality.

Funny enough it still exists inside Google Lens on Android if you use the Text feature, can copy to my PC.

@corbindavenport
Copy link
Owner Author

If you mean Chrome on Android, it switched to a custom share sheet somewhere around v85 in 2020: https://www.androidpolice.com/2020/08/26/chrome-85-enables-64-bit-support-on-android-10-replaces-the-share-sheet-and-more-apk-download/

The normal Android share sheet has easier access to clipboard and other apps, I really don't like Chrome switching to its own (worse) menu. Google has probably added and removed buttons from the menu over time.

@corbindavenport
Copy link
Owner Author

corbindavenport commented Jun 22, 2024

This is implemented now as an opt-in setting, but currently requires the Clipboard API, and the error catching isn't fully working yet. Gonna do more testing before closing.

In Firefox for example, the popup confirmation appears when shortening a link with the url parameter, but there's an error in the console:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants