Greasy Fork

Greasy Fork is available in English.

洛谷顶栏添加其他链接

洛谷顶栏添加其他链接,可自定义

当前为 2022-06-23 提交的版本,查看 最新版本

// ==UserScript==
// @name         洛谷顶栏添加其他链接
// @description  洛谷顶栏添加其他链接,可自定义
// @namespace    http://greasyfork.icu/zh-CN/users/772347
// @version      1.1
// @author       WYXkk
// @match        https://www.luogu.com.cn/
// @match        https://www.luogu.com.cn/chat*
// @match        https://www.luogu.com.cn/notification*
// @match        https://www.luogu.com.cn/user/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    //将网站的链接及文本在下方添加即可,下面只是一个示例
    var x=[
        {link:'https://www.bilibili.com',text:'Bilibili'},
        ];
    function add()
    {
        if(document.querySelectorAll('.link-container')[0]==undefined) setTimeout(function(){add()},50);
        else setTimeout(function(){for(var i in x){
            var a=document.createElement("a");document.querySelectorAll('.link-container')[0].append(a);a.outerHTML=
        '<a data-v-303bbf52=\"\" data-v-e6ccd65e=\"\" href=\"'+x[i].link+'\" target=\"_blank\" colorscheme=\"none\" class=\"header-link color-none\">'+x[i].text+'</a>'
        ;}},100);
    }
    add();
})();