Skip to content

Instantly share code, notes, and snippets.

@sinsoku
Last active December 24, 2020 02:44
Show Gist options
  • Save sinsoku/fc1ca0b9a16f76123afa4fe2f45cd371 to your computer and use it in GitHub Desktop.
Save sinsoku/fc1ca0b9a16f76123afa4fe2f45cd371 to your computer and use it in GitHub Desktop.
WIP Pull Request Unhighlignter for GitHub が使えなくなったので、 Tampermonkey の UserScript で再実装した
// ==UserScript==
// @name WIP Pull Request Unhighlignter
// @author sinsoku
// @version 0.4
// @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) {
return el.textContent.match('WIP');
});
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