GitHub PR Bookmarklet
GitHubのPull Requestページで実行して、PRタイトル・番号・URLをまとめてクリップボードにコピーするブックマークレット
js javascript:(function() { if (location.hostname !== 'github.com' || !/^\/[^/]+\/[^/]+\/pull\/\d+(?:\/|$)/.test(location.pathname)) { alert('This page is not a GitHub Pull Request page.'); return; } const prTitle = document.querySelector('h1[data-component="PH_Title"] span[data-component="Text"]').textContent.trim(); const prNumber = document.querySelector('h1[data-component="PH_Title"] .sr-only').textContent.trim().replace(/\-\s*/, ""); const prUrl = location.href.replace(/^(.*?\/pull\/\d+).*$/, %27$1%27); const formattedText = `[${prTitle} ${prNumber} ${prUrl}]`; navigator.clipboard.writeText(formattedText).then(() => { window.prompt(%27PR information copied to clipboard:%27, formattedText); }).catch(err => { console.error(%27Failed to copy to clipboard:%27, err); window.prompt(%27Please copy the text manually:%27, formattedText); });})();js// ~ 2026/7/30javascript:(function() { if (!location.href.includes('github.com') || !location.href.includes('/pull/')) { alert('This page is not a GitHub Pull Request page.'); return; } const prTitle = document.querySelector('h1.gh-header-title .js-issue-title').textContent.trim(); const prNumber = document.querySelector('h1.gh-header-title .f1-light').textContent.trim(); const prUrl = location.href.replace(/^(.*?\/pull\/\d+).*$/, %27$1%27); const formattedText = `[${prTitle} ${prNumber} ${prUrl}]`; navigator.clipboard.writeText(formattedText) .then(() => { window.prompt(%27PR information copied to clipboard:%27, formattedText); }) .catch(err => { console.error(%27Failed to copy to clipboard:%27, err); window.prompt(%27Please copy the text manually:%27, formattedText); });})();js// ~ 2026/2/11javascript:(function() { if (!location.href.includes('github.com') || !location.href.includes('/pull/')) { alert('This page is not a GitHub Pull Request page.'); return; } const prTitle = document.querySelector('h1[data-component="PH_Title"] > span').textContent.trim(); const prNumber = document.querySelector('h1[data-component="PH_Title"] .f1-light').textContent.trim(); const prUrl = location.href.replace(/^(.*?\/pull\/\d+).*$/, %27$1%27); const formattedText = `[${prTitle} ${prNumber} ${prUrl}]`; navigator.clipboard.writeText(formattedText) .then(() => { window.prompt(%27PR information copied to clipboard:%27, formattedText); }) .catch(err => { console.error(%27Failed to copy to clipboard:%27, err); window.prompt(%27Please copy the text manually:%27, formattedText); });})();js// ~ 2026/2/4javascript:(function() { if (!location.href.includes('github.com') || !location.href.includes('/pull/')) { alert('This page is not a GitHub Pull Request page.'); return; } const prTitle = document.querySelector('h1.gh-header-title .js-issue-title').textContent.trim(); const prNumber = document.querySelector('h1.gh-header-title .f1-light').textContent.trim(); const prUrl = location.href.replace(/^(.*?\/pull\/\d+).*$/, %27$1%27); const formattedText = `[${prTitle} ${prNumber} ${prUrl}]`; navigator.clipboard.writeText(formattedText) .then(() => { window.prompt(%27PR information copied to clipboard:%27, formattedText); }) .catch(err => { console.error(%27Failed to copy to clipboard:%27, err); window.prompt(%27Please copy the text manually:%27, formattedText); });})();