Last active
December 28, 2021 04:52
-
-
Save tkdn/f8fcf637fc2bc60e01f64ee7025186c3 to your computer and use it in GitHub Desktop.
SHA 短いのがクリップボードにほしい
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
// ==UserScript== | |
// @name 出、出~短管理識別子取奴〜 | |
// @namespace https://gist.github.com/tkdn/f8fcf637fc2bc60e01f64ee7025186c3#file-github-copy-short-sha.user.js | |
// @updateURL https://gist.githubusercontent.com/tkdn/f8fcf637fc2bc60e01f64ee7025186c3/raw/58daa1a22a7845d838efc1786c30c96acc7ce050/github-copy-short-sha.user.js | |
// @downloadURL https://gist.githubusercontent.com/tkdn/f8fcf637fc2bc60e01f64ee7025186c3/raw/58daa1a22a7845d838efc1786c30c96acc7ce050/github-copy-short-sha.user.js | |
// @version 0.1 | |
// @description GitHub の SHA コピーを短いやつにする | |
// @author tkdn <tkdnation@gmail.com> | |
// @match https://github.com/*/* | |
// @grant none | |
// ==/UserScript== | |
(() => { | |
console.log('出、出~短管理識別子取奴〜') | |
setup() | |
document.addEventListener('pjax:end', setup) | |
function setup() { | |
const $elems = document.querySelectorAll('clipboard-copy[aria-label="Copy the full SHA"]') | |
$elems.forEach(elem => { | |
elem.value = elem.value.substring(0,8) | |
}) | |
} | |
function sleep(ms) { | |
return new Promise(r => setTimeout(r, ms)) | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment