Ultimate-Guitar No BS

Display only the <pre> block on Ultimate Guitar

// ==UserScript==
// @name         Ultimate-Guitar No BS
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Display only the <pre> block on Ultimate Guitar
// @author       You
// @match        *://tabs.ultimate-guitar.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Wait for the DOM to fully load
    window.addEventListener('load', () => {
        // Select the <pre> block
        const preBlock = document.querySelector('pre');

        if (preBlock) {
            // Clear the body content except for the <pre> block
            document.body.innerHTML = '';

            // Set the pre block as the only content
            const newPreContainer = document.createElement('div');
            newPreContainer.style.margin = '0';
            newPreContainer.style.padding = '10px';
            newPreContainer.style.backgroundColor = '#f4f4f4';
            newPreContainer.style.color = 'black'; // White text color
            newPreContainer.style.fontFamily = 'monospace';
            newPreContainer.style.fontSize = '16px';

            newPreContainer.appendChild(preBlock.cloneNode(true)); // Clone and append the <pre> block

            // Append the new content to the body
            document.body.appendChild(newPreContainer);

            console.log('Page simplified to display only the <pre> block.');
        } else {
            console.warn('No <pre> block found on this page.');
        }
    });
})();