Skip to content

Instantly share code, notes, and snippets.

@tayiorbeii
Created August 2, 2018 20:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tayiorbeii/6a1b8c4441590e202f8c88d783271802 to your computer and use it in GitHub Desktop.
Save tayiorbeii/6a1b8c4441590e202f8c88d783271802 to your computer and use it in GitHub Desktop.
Userscript to remove target=_blank
// ==UserScript==
// @name No New Tabs
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
Array.from(document.querySelectorAll('a[target="_blank"]'))
.forEach(link => link.removeAttribute('target'));
})();
@Cyclics
Copy link

Cyclics commented Apr 27, 2023

Really helpful. Thank you.

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