Skip to content

Instantly share code, notes, and snippets.

@kuceb
Last active June 19, 2021 01:31
Show Gist options
  • Save kuceb/0ae6f4545aacec8c3db598eb88e48955 to your computer and use it in GitHub Desktop.
Save kuceb/0ae6f4545aacec8c3db598eb88e48955 to your computer and use it in GitHub Desktop.
Tampermonkey script to open all links from github notification page in new tab.
// ==UserScript==
// @name Github notifications: Open in new tab
// @namespace io.kuc.ben
// @version 1.1
// @description Open all links from github notification page in new tab. Works for old and new notifications pages.
// @author bkucera
// @match https://github.com/notifications/*
// @match https://github.com/notifications*
// ==/UserScript==
(function() {
'use strict';
document.addEventListener('click', (e)=>{
const aEl = e.path.find(el => el.tagName === 'A')
if (aEl) {
aEl.target = '_blank'
}
})
})();
@kuceb
Copy link
Author

kuceb commented Feb 18, 2020

I recommend tampermonkey for running this script

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