Ouedkniss Elements Remover

Remove sponsored banners from Ouedkniss

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

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         Ouedkniss Elements Remover
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Remove sponsored banners from Ouedkniss
// @author       Harrysof
// @icon         https://greasyfork.s3.us-east-2.amazonaws.com/9emqda6d7wwfzlfawkqaxcqx6o5h
// @match        https://www.ouedkniss.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    // Array of selectors to remove
    const selectorsToRemove = [
        '.page-top-1',
        '.o-section-heading',
        '.home-promo-header'
    ];

    function removeElements(selector) {
        const elements = document.querySelectorAll(selector);
        elements.forEach(element => element.remove());
    }

    function removeBlur() {
        const blurredElements = document.querySelectorAll('[class*="blurred"]');
        blurredElements.forEach(element => {
            element.style.filter = 'none';
            element.classList.remove('blurred');
        });
    }

    function load() {
        // Remove specified elements
        selectorsToRemove.forEach(selector => removeElements(selector));
        removeBlur(); // Remove blur effects if any
    }

    load();

    for (const f of ['pushState', 'replaceState', 'forward', 'back', 'go']) {
        const fn = history[f];
        history[f] = function(...args) {
            fn.apply(this, args);
            load();
        };
    }
    const observer = new MutationObserver(() => {
        selectorsToRemove.forEach(selector => removeElements(selector));
        removeBlur();
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();