Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name No New Tabs
- // @match *
- // @grant none
- // ==/UserScript==
- (function() {
- document.querySelectorAll('a[target]').forEach((link) => {
- link.setAttribute('target', '_self');
- link.setAttribute('rel', 'noopener noreferrer');
- });
- document.querySelectorAll('base[target]').forEach((base) => {
- base.setAttribute('target', '_self');
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement