Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. javascript: (
  2. function() {
  3. var text = '[' + document.title + '](' + location.href + ')';
  4. const input = document.createElement('input');
  5. document.body.appendChild(input);
  6. input.value = text;
  7. input.focus();
  8. input.select();
  9. const result = document.execCommand('copy');
  10. if (result === 'unsuccessful') {
  11. console.error('Failed to copy text.', result);
  12. } else {
  13. console.log('copied', text);
  14. alert("Copied "+ text);
  15. }
  16. }
  17. )
  18. ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement