-
-
Save powersee/def6b326942570c980697caac9205f0f to your computer and use it in GitHub Desktop.
Tampermonkey script to open all links from github 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 links: Open in new tab | |
// @namespace io.kuc.ben | |
// @version 1.1 | |
// @description Open all links from github in new tab. | |
// @author bkucera,powersee | |
// @match https://github.com/* | |
// ==/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