Skip to content

Instantly share code, notes, and snippets.

@akameco
Created October 25, 2017 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akameco/55df9e12beec3e7e4e1b1c5faa4f6062 to your computer and use it in GitHub Desktop.
Save akameco/55df9e12beec3e7e4e1b1c5faa4f6062 to your computer and use it in GitHub Desktop.
GitHubのヘッダーにTodoまでの導線を追加するGMスクリプト
// ==UserScript==
// @name Todos
// @namespace akameco.github.io
// @version 0.1
// @description Add Todos & 今日中 Link
// @author You
// @match https://github.com/*
// @grant none
// ==/UserScript==
(function() {
const ul = document.querySelector('.HeaderMenu ul');
const addHeaderLink = ({title, href}) => {
const linkText = document.createTextNode(title);
const a = document.createElement('a');
a.title = title;
a.href = href;
a.className = "js-selected-navigation-item HeaderNavlink px-2";
a.appendChild(linkText);
const li = document.createElement('li');
li.appendChild(a);
ul.appendChild(li);
};
addHeaderLink({title: 'Todos', href: '/akameco/works/issues'});
addHeaderLink({title: '今日中', href: '/akameco/works/issues?q=is%3Aissue+is%3Aopen+label%3A今日中'});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment