LeetCode discuss solution automatically filters JS

Easy-to-edit userscript to filter solution tab for Leetcode solutions. In the example it filters to Javascript

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         LeetCode discuss solution automatically filters JS
// @description  Easy-to-edit userscript to filter solution tab for Leetcode solutions. In the example it filters to Javascript
// @namespace    https://github.com/marcodallagatta/userscripts/raw/main/leetcode-filter-solutions
// @version      2022.09.02.20.15
// @author       Marco Dalla Gatta
// @match        https://leetcode.com/problems/*/discuss/*
// @icon         https://icons.duckduckgo.com/ip2/leetcode.com.ico
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {

    const filter = 'javascript';

    'use strict';
    if (!window.location.toString().includes('tag')) {
        window.location += `?currentPage=1&orderBy=most_votes&query=&tag=${filter}`
    }
})();