Skip to content

Instantly share code, notes, and snippets.

@omgmog
Created July 31, 2017 15:09
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 omgmog/5929bfc3f99631ec718b04769a41be46 to your computer and use it in GitHub Desktop.
Save omgmog/5929bfc3f99631ec718b04769a41be46 to your computer and use it in GitHub Desktop.
Open all of the issues in new tabs when clicking a link of `href="open10"`
// ==UserScript==
// @name Open all the issues
// @namespace https://blog.omgmog.net/
// @version 0.1
// @description Opens all of the issues on the current page in new windows
// @author You
// @match https://github.com/*/*/issues
// @grant none
// ==/UserScript==
(function() {
'use strict';
function open10click(e) {
e.preventDefault();
let links = document.querySelectorAll('.issues-listing .js-issue-row .js-navigation-open');
for (let i=0; i<links.length;i++) {
window.open(links[i].href, i);
}
}
document.querySelector('[href="#open10"]').onclick = open10click;
})();
@omgmog
Copy link
Author

omgmog commented Jul 31, 2017

Used in conjunction with this userscript: https://greasyfork.org/scripts/20830-github-custom-navigation/code/GitHub%20Custom%20Navigation.user.js

screen shot 2017-07-31 at 16 30 08

Icon:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" fill="#000000" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve"><path d="M85.4,5H14.6C9.3,5,5,9.3,5,14.6v70.7c0,5.3,4.3,9.6,9.6,9.6h70.7c5.3,0,9.6-4.3,9.6-9.6V14.6C95,9.3,90.7,5,85.4,5z   M88.6,85.4c0,1.8-1.4,3.2-3.2,3.2H14.6c-1.8,0-3.2-1.4-3.2-3.2V14.6c0-1.8,1.4-3.2,3.2-3.2h70.7c1.8,0,3.2,1.4,3.2,3.2v70.8H88.6z"/><polygon points="40.4,30.7 64.7,30.7 25.2,70.2 29.8,74.8 69.3,35.3 69.3,59.6 75.7,59.6 75.7,24.3 40.4,24.3 "/></svg>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment