Skip to content

Instantly share code, notes, and snippets.

@oieioi
Last active November 29, 2017 02:37
Show Gist options
  • Save oieioi/36f7cb3762cd7fb2851e2a303eeada81 to your computer and use it in GitHub Desktop.
Save oieioi/36f7cb3762cd7fb2851e2a303eeada81 to your computer and use it in GitHub Desktop.
プルリクお知らせ
// ==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