您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hide Premium Problems on Leetcode
当前为
您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
- // ==UserScript==
- // @name leetcode show total and remain unlocked questions
- // @description:en Show Total and Remain Unlocked Problems on Leetcode
- // @namespace https://greatest.deepsurf.us/en/users/22079-hntee
- // @version 0.1
- // @author hntee
- // @match https://leetcode.com/*
- // @description Hide Premium Problems on Leetcode
- // ==/UserScript==
- (function() {
- 'use strict';
- observeDomChange();
- })();
- function observeDomChange() {
- var MutationObserver = window.MutationObserver;
- var myObserver = new MutationObserver (mutationHandler);
- var obsConfig = {
- childList: true, attributes: true,
- subtree: true, attributeFilter: ['list-group']
- };
- myObserver.observe(document, obsConfig);
- function mutationHandler (mutationRecords) {
- var locked = "div > i.fa-lock";
- var num_locked = $(locked).length;
- $(locked).parent().parent().parent().hide();
- if ($('#welcome strong').length == 1) {
- info = $('#welcome strong').text();
- num_finished = Number(info.split('/')[0]);
- num_questions = Number(info.split('/')[1]);
- num_unlocked = num_questions - num_locked;
- $('#welcome').append(' (Locked: ' + num_locked + ')<br />You have solved: <strong>' + num_finished + "/" + num_unlocked + ' (' + (num_unlocked - num_finished) + ')</strong> remain');
- }
- }
- }