Remove Spotify Now Playing View

Remove the Now Playing view element and div with a specific class from the page

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Remove Spotify Now Playing View
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  Remove the Now Playing view element and div with a specific class from the page
// @author       Drewby123
// @match        *://open.spotify*/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    console.log('Tampermonkey script loaded');

    function removeNowPlayingView() {
        // Remove the Now Playing view by ID
        const nowPlayingView = document.getElementById('Desktop_PanelContainer_Id');
        if (nowPlayingView) {
            nowPlayingView.remove();
            console.log('Now Playing view removed');
        }

        // Remove the div with class OTfMDdomT5S7B5dbYTT8
        const specificDiv = document.querySelector('.OTfMDdomT5S7B5dbYTT8');
        if (specificDiv) {
            specificDiv.remove();
            console.log('Div with class OTfMDdomT5S7B5dbYTT8 removed');
        }
    }

    // Run the function when the page is fully loaded
    window.addEventListener('load', removeNowPlayingView);

    // Observe the document for dynamically added elements
    const observer = new MutationObserver(() => removeNowPlayingView());
    observer.observe(document.body, { childList: true, subtree: true });
})();