Created
August 22, 2023 19:27
-
-
Save andreineculau/d65e13ab5d0ebdd493c35ab4a2cd5b26 to your computer and use it in GitHub Desktop.
Remove a.target usercript
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 Remove a.target | |
// @version 0.1 | |
// @match http://*/* | |
// @match https://*/* | |
// @grant none | |
// @run-at document-idle | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var remove = () => { | |
[...document.querySelectorAll('a[target]')].forEach(function (a) { | |
self === top ? a.removeAttribute('target') : a.setAttribute('target', '_top'); | |
}); | |
} | |
window.setInterval(() => remove(), 5 * 1000); | |
remove(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment