Hide Leecode locked problems

Revision en2, by PJdan, 2022-02-12 13:58:09

Without Leetcode Premium, it's annoying to have to see those locked problems.

Here is a user script used to hide locked problems in Leetcode.

  1. Install Tampermonkey
  2. Create a new script:
// ==UserScript==
// @name         Hide locked Leetcode problems
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Hides locked Leetcode problems
// @author       PJDan
// @match        https://leetcode.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=leetcode.com
// @grant        none
// ==/UserScript==

$(document).ready(function() {
    setTimeout(hide, 5000);

    function hide() {
        document.querySelector('.reactable-th-frequency').remove();
        document.querySelectorAll('.frequency-locked').forEach(e => e.remove());
        var lockItems = $(".fa-lock");
        lockItems.closest('tr').hide();
    }
});

Make sure the script is enabled

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English PJdan 2022-02-12 15:16:32 2 Tiny change: 'out(hide, 5000);\n\n ' -> 'out(hide, 3000);\n\n '
en2 English PJdan 2022-02-12 13:58:09 3 Tiny change: 'n~~~~~\n\n3. Make sure ' -> 'n~~~~~\n\nMake sure '
en1 English PJdan 2022-02-12 13:57:01 1013 Initial revision (published)