Last active
October 18, 2022 12:58
-
-
Save DavideViolante/04e42628b9e6b4a2f8aec3875e44990c to your computer and use it in GitHub Desktop.
This file contains 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 HN target blank | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description Open Hacker News links in a new tab | |
// @author Davide Violante | |
// @match https://news.ycombinator.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const titles = document.getElementsByClassName('titleline'); | |
for (const title of titles) { | |
title.childNodes[0].setAttribute('target', '_blank'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment