🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Leetcode invisible

A script to hide Leetcode question difficultly

2020/06/11のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Leetcode invisible
// @version      0.1
// @description  A script to hide Leetcode question difficultly
// @author       osjobs.net
// @match        https://leetcode.com/*
// @exclude      https://leetcode.com/problems/*/discuss/*
// @grant        none
// @namespace https://greasyfork.org/users/555531
// ==/UserScript==


// Since Leetcode use Ajax to load content,
// we have to check the label in first few seconds
if (window.location.href.indexOf("problemset") > -1) {
    var problemsetTimer = setInterval(problemsetFunction, 2000);
} else if (window.location.href.indexOf("problems") > -1) {
    var updateTime = 0;
    var problemTimer = setInterval(problemFunction, 100);
}


function problemsetFunction() {
    // Problems list page
    if(document.querySelector("span.label-warning")) {
        var elementE = document.querySelectorAll("span.label-success");
        var elementM = document.querySelectorAll("span.label-warning");
        var elementH = document.querySelectorAll("span.label-danger");
        update(elementE, "label-success");
        update(elementM, "label-warning");
        update(elementH, "label-danger");
    }
}

function problemFunction () {
    if (updateTime > 0) {
        clearInterval(problemTimer);
    }
    if(document.querySelector("div.css-10o4wqw")) {
        var element = document.getElementsByClassName("css-10o4wqw")[0];
        var child = element.getElementsByTagName("div")[0];
        child.textContent = "Unknown";
        child.className = child.className.replace(/css.*/,"");
        updateTime += 1;
    }
    if(document.querySelector("div.difficulty__ES5S")) {
        var similar_element = document.getElementsByClassName("difficulty__ES5S");
        for (var i=0; i<similar_element.length; i++) {
            similar_element[i].textContent = "Unknown";
        }
    }
}

function update(element, classname) {
    for (var i=0; i < element.length; i++) {
        element[i].classList.remove(classname);
        element[i].textContent = "Unknown";
    }
}