v2ex-open-new-page

在 v2ex 里,所有的 a 标签自动打开新页面

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         v2ex-open-new-page
// @namespace    http://tampermonkey.net/
// @version      2024-03-12
// @description  在 v2ex 里,所有的 a 标签自动打开新页面
// @author       @zhixiangyao
// @match        https://www.v2ex.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=v2ex.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    // 创建一个 base 元素
    var baseElement = document.createElement('base');
    // 设置 target 属性为 "_blank"
    baseElement.setAttribute('target', '_blank');
    // 将 base 元素插入到页面的 head 元素中
    document.head.appendChild(baseElement);
})();