Hide Promotion Advertisement at Codewars Site

Remove certain elements from the page

Versione datata 20/08/2024. Vedi la nuova versione l'ultima versione.

// ==UserScript==
// @name         Hide Promotion Advertisement at Codewars Site
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Remove certain elements from the page
// @author       aspen138
// @match        *://*.codewars.com/*
// @icon         https://www.google.com/s2/favicons?domain=codewars.com
// @license      MIT
// @grant        none
// ==/UserScript==


(function() {
    'use strict';

    // Select the elements based on their class names, IDs, or tags
    const descriptionFooter = document.querySelector('.description-footer');
    const partnerDisplay = document.getElementById('partner-display');
    const textCenter = document.querySelector('.text-center');
    const bonusPointsHeader = document.getElementById('bonus-points-not-really-but-just-for-fun');
    const descriptionFullHeight = document.querySelector('.description.h-full');
    const descriptionContent = descriptionFullHeight.querySelector('.description-content');

    // Remove the elements if they exist
    if (descriptionFooter) {
        descriptionFooter.remove();
    }

    if (partnerDisplay) {
        partnerDisplay.remove();
    }

    if (textCenter) {
        textCenter.remove();
    }

    if (bonusPointsHeader) {
        bonusPointsHeader.remove();
    }

    // Make the description-content full height
    if (descriptionContent) {
        descriptionContent.style.height = '100%';
        descriptionContent.style.display = 'flex';
        descriptionContent.style.flexDirection = 'column';
    }
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。