Last active
August 14, 2020 07:46
-
-
Save rockymanobi/0c95c9f72f3ca09558b8def068a7d839 to your computer and use it in GitHub Desktop.
Bookmarklet that copies URL, title, content of Github Issue
This file contains 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
javascript:(function(){ function copyTextToClipboard(textVal){ const copyFrom = document.createElement("textarea"); copyFrom.textContent = textVal; const bodyElm = document.getElementsByTagName("body")[0]; bodyElm.appendChild(copyFrom); copyFrom.select(); const retVal = document.execCommand('copy'); bodyElm.removeChild(copyFrom); return retVal; } const href = location.href; const title = document.querySelector('.js-issue-title').innerHTML.trim(); const issue = document.querySelector('textarea[name="issue[body]"]').value; const text = [href, title, issue].join('\n\n#######\n\n'); alert(text); copyTextToClipboard(text); }()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bookmarkletの設定をして、GithubのIssueの画面から呼び出してあげると、クリップボードに URL, Issueタイトル, 本文がコピーされます。今の所ZenHubでも使えました。