Last active
November 29, 2017 02:37
-
-
Save oieioi/36f7cb3762cd7fb2851e2a303eeada81 to your computer and use it in GitHub Desktop.
プルリクお知らせ
This file contains hidden or 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 Notify pull requests required your review | |
// @namespace https://gist.github.com/oieioi/ | |
// @version 0.6 | |
// @description Notify pull requests required your review | |
// @author oieioi | |
// @match https://github.com/pulls/review-requested | |
// @match https://github.com/*/*/pulls/review-requested/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
if (Notification.permission !== "denied") { | |
Notification.requestPermission(); | |
} | |
if (Notification.permission === "denied") { | |
return; | |
} | |
const pulls = document.querySelectorAll('.js-active-navigation-container > li'); | |
let n = null; | |
if (pulls.length > 0) { | |
n = new Notification(`レビューが${pulls.length}件あります`, { | |
icon: "https://assets-cdn.github.com/images/modules/site/logos/desktop-logo.png", | |
title: "GitHub" | |
}); | |
n.onclick = function(){ | |
window.open("https://github.com/pulls/review-requested"); | |
n.close(); | |
}; | |
} | |
setTimeout( () => { | |
if (n) n.close(); | |
location.reload(); | |
}, 120 * 1000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment