Created
May 1, 2020 16:41
-
-
Save davewasmer/a1443bd7df03d13d6279dee35db194e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function copyUrlToClipboard() { | |
| let url = getUrlThatICareAbout(); | |
| // Check the docs here, you'll need to pass in a DataTransfer object, | |
| // so you'll need to lookup the docs for how to create one that captures | |
| // the url string above. | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/write | |
| navigator.clipboard.write(/* some DataTransfer object */) | |
| } | |
| let delay = /* however long you want to wait, in ms */ | |
| setTimeout(copyUrlToClipboard, delay); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment