fandomClear

Clear the Fandom.com layout for easy print.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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           fandomClear
// @description    Clear the Fandom.com layout for easy print.
// @description:ru Очищает макет Fandom.com для простой печати.
// @namespace      fandom
// @match          https://*.fandom.com/*
// @require        http://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @version        1.2
// @author         Nikolay Raspopov
// @license        MIT
// @icon           https://www.google.com/s2/favicons?domain=fandom.com&sz=32
// @grant          none
// ==/UserScript==

(function() {
    'use strict';
    var $ = window.jQuery;
    $(document).ready( setTimeout( function(){
        $('.page-header__actions').append("<div class='clearIt' style='padding: 8px;'><button type='button'> 🧹 </button></div>");
        $('.clearIt').click( function() {
            $('*').contents().each( function(){
                if(this.nodeType === Node.COMMENT_NODE){
                    $(this).remove();
                }
            });
            $('script').remove();
            $('noscript').remove();
            $('iframe').remove();
            $('aside').remove();
            $('footer').remove();
            $('.top-ads-container').remove();
            $('.bottom-ads-container').remove();
            $('.ad-slot').remove();
            $('.ac-widget-placeholder').remove();
            $('.community-header-wrapper').remove();
            $('.fandom-community-header__background').remove();
            $('.fandom-sticky-header').remove();
            $('.notifications-placeholder').remove();
            $('.page-footer').remove();
            $('.page-side-tools').remove();
            $('.page-side-tools__wrapper').remove();
            $('.page-header__actions').remove();
            $('.page-header__meta').remove();
            $('.page-header__languages').remove();
            $('.page__right-rail').remove();
            $('.global-navigation').remove();
            $('.render-wiki-recommendations').remove();
            $('#mixed-content-footer').remove();
            $('#WikiaBar').remove();
            $('.global-footer').remove();
            $('.wikia-bar-collapse').remove();
            $('#highlight__main-container').remove();
            $('#highlight-portal-modal-container').remove();
            $('html, body, .main-container, .page__main').css({
                'background-color' : 'white',
            });
            $('.resizable-container, .main-container, .page').css({
                'max-width' : 'none',
                'min-width' : 'none',
                'margin' : 'auto',
                'padding' : 'unset',
                'width' : '100%',
            });
            $('.clearIt').remove(); // self-destruct
        });
    }, 2000 ) ); // revive delay
})();