过滤无效共享文件夹信息

针对共享到的人才文件夹,只保留OD信息,其他信息全部过滤掉

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         过滤无效共享文件夹信息
// @namespace    invalid
// @include      *://majesty.hr-mp.com/*
// @version      1.0
// @description  针对共享到的人才文件夹,只保留OD信息,其他信息全部过滤掉
// @author       Leevege
// @match        https://greasyfork.org/en
// @grant        none
// ==/UserScript==

//(function() {
    'use strict';
    //window.addEventListener('load', function() {
    // your code here
function init(){
    console.log("过滤插件已加载!");
    var allElement = document.getElementsByTagName("div")
    var found;
    for (var i = 275; i < allElement.length; i++) {
        if(allElement[i].textContent.match("共享到的"))
        {
            found = allElement[i];
            break;
        }
    }
    var found2 = found.parentElement.parentElement.parentElement;
    var deleteBase = found2.querySelector("div:nth-child(2)");
    var deleteList = deleteBase.querySelector(":nth-child(1)").querySelector(":nth-child(1)");
    var inner = document.createElement('span');
    function removeElement(){
        for (var i = 0; i < deleteList.childElementCount; i++){
            if(!deleteList.children[i].textContent.match("OD"))
            {deleteList.children[i].remove();}
        }
    }
    //var button = `<button onclick="removeElement()">过滤OD</button>`;
    //inner.innerHTML = button;
    //found.append(inner);
    for(var re=0; re<10;re++){
        removeElement();
    }
}
    setTimeout(init, 3000);
    //}, false);
//})();