Advertisement
Huxulm

LC净化脚本

Apr 24th, 2024 (edited)
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         隐藏元素
  3. // @namespace    http://tampermonkey.net/
  4. // @version      2024-04-23
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://leetcode.cn/*
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=leetcode.cn
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.     'use strict';
  14.  
  15.     const hides = [
  16.         'a[class="mb-0.5 flex items-center mr-8"]', // brand
  17.         'ul[class="relative mr-2 flex h-10 items-center"]',// brand
  18.         'a[class="-mr-2 md:mr-0"]', // 推荐
  19.         'div[class="mt-8"]', // 学习计划
  20.         'div[class="-mr-2 md:mr-0"]', // 学习计划
  21.         'div[class="col-span-4 md:col-span-1"]', // 侧边栏
  22.         'footer',
  23.     ];
  24.     var fn = () => {
  25.         hides.forEach(function(v) {
  26.             const node = document.querySelector(v);
  27.             if (node && node.style) {
  28.                 node.style.display = "none";
  29.             }
  30.         })
  31.     };
  32.  
  33.     [500, 1000, 3000].forEach(t => setTimeout(fn, t));
  34.     setInterval(fn, 10000);
  35. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement