Last active
June 19, 2021 01:31
-
-
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.
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 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' | |
} | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I recommend tampermonkey for running this script