Greasy Fork is available in English.

添加DOTA2版块到S1快速访问

将DOTA2版块添加到saraba1st论坛的导航栏中

// ==UserScript==
// @name         添加DOTA2版块到S1快速访问
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  将DOTA2版块添加到saraba1st论坛的导航栏中
// @author       S1傻狗
// @match        https://*.saraba1st.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Create a new link element
    var newListItem = document.createElement('li');
    var newLink = document.createElement('a');
    newLink.href = 'https://bbs.saraba1st.com/2b/forum-138-1.html';
    newLink.textContent = 'DOTA2';
    newLink.hidefocus = 'true';
    newListItem.appendChild(newLink);

    // Find the top navigation bar
    var navBar = document.querySelector('#nv ul');

    if (navBar) {
        // Find the VTB link's list item
        var vtbListItem = navBar.querySelector('li[id="mn_F151"]');

        if (vtbListItem) {
            // Insert the new list item before the VTB list item
            navBar.insertBefore(newListItem, vtbListItem);
        }
    }
})();