Custom YouTube Interface

Customize YouTube interface by hiding certain elements and making modifications.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Custom YouTube Interface
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Customize YouTube interface by hiding certain elements and making modifications.
// @author       You
// @match        *://www.youtube.com/*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // CSS to hide certain elements and apply custom styles
    GM_addStyle(`
        /* Hide Like and Dislike buttons */
        ytd-toggle-button-renderer.style-scope.ytd-video-primary-info-renderer {
            display: none !important;
        }

        /* Hide Download and Save buttons */
        ytd-menu-renderer.style-scope.ytd-video-primary-info-renderer ytd-menu-popup-renderer {
            display: none !important;
        }

        /* Hide Description */
        #description {
            display: none !important;
        }

        /* Hide Comments */
        #comments {
            display: none !important;
        }

        /* Hide Shorts */
        ytd-rich-grid-media[is-shorts] {
            display: none !important;
        }

        /* Make video list on watch page bigger */
        ytd-playlist-video-list-renderer {
            width: 100% !important;
        }

        /* Replace logo with back button */
        #logo {
            display: none !important;
        }

        #back-button {
            position: absolute;
            top: 10px;
            left: 10px;
            background: #fff;
            border: 1px solid #ccc;
            padding: 5px;
            cursor: pointer;
        }

        #back-button:hover {
            background: #f0f0f0;
        }

        /* Adjust Search bar to be an icon */
        #search {
            display: none !important;
        }

        #search-icon {
            position: absolute;
            top: 10px;
            right: 10px;
            background: url('path_to_icon_image') no-repeat center;
            width: 24px;
            height: 24px;
            cursor: pointer;
        }
    `);

    // JavaScript to create a back button
    const backButton = document.createElement('div');
    backButton.id = 'back-button';
    backButton.textContent = 'Back'; // You can change this text or use an icon
    document.body.appendChild(backButton);
    backButton.addEventListener('click', () => window.history.back());

    // JavaScript to create a search icon
    const searchIcon = document.createElement('div');
    searchIcon.id = 'search-icon';
    document.body.appendChild(searchIcon);
    searchIcon.addEventListener('click', () => {
        const searchField = document.querySelector('input#search');
        if (searchField) {
            searchField.focus();
        }
    });

})();