-
-
Save ta1kt0me/a2787d74a83ed2734de734772728ab0d to your computer and use it in GitHub Desktop.
WIP Pull Request Unhighlignter for GitHub が使えなくなったので、 Tampermonkey の UserScript で再実装した
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 WIP Pull Request Unhighlignter | |
// @author sinsoku | |
// @version 0.4.1 | |
// @match https://github.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var unhighlignter = function() { | |
if (!location.pathname.match(/pulls$/)) { | |
return; | |
} | |
var pulls = document.querySelectorAll('[id^="issue"]'); | |
var wipPulls = Array.from(pulls).filter(function(el) { | |
// TODO: draft may be normal keyword | |
return el.textContent.match(/wip|draft/i); | |
}); | |
wipPulls.forEach(function(el) { | |
el.style.backgroundColor = 'lightgray'; | |
el.style.opacity = 0.7; | |
}); | |
}; | |
window.addEventListener('load', unhighlignter); | |
window.addEventListener('pjax:end', unhighlignter); | |
var observer = new MutationObserver(unhighlignter); | |
var body = document.querySelector('body'); | |
observer.observe(body, { childList: true, subtree: true}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment