My Own Apple Music Tweaks

Allow drag selection & adjust sidebar position so it doesn't hide the scroll bar

目前为 2023-05-14 提交的版本。查看 最新版本

// ==UserScript==
// @name         My Own Apple Music Tweaks
// @description  Allow drag selection & adjust sidebar position so it doesn't hide the scroll bar
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http*://music.apple.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=apple.com
// @grant        GM_addStyle
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const l = (m) => {
        console.log("Apple Music Tweaks:", m);
    };

    window.addEventListener('load', function() {
        const getSongListEInterval = setInterval(() => {
            (function() {
                const songListEList = document.querySelectorAll('div.songs-list');
                if (songListEList.length <= 0) {
                    return;
                }
                const songListE = songListEList[0];
                if (songListE['__draggable_already_injected__'] === '1') {
                    return;
                }
                songListE['__draggable_already_injected__'] = '1';
                Object.defineProperty(songListE, 'draggable', { set: function(value) { return; } })
                songListE.setAttribute('draggable', false)
                // window.sx = songListE;
                // l("songList got");
                setTimeout(() => {
                    songListE.setAttribute('draggable', false);
                }, 100);
                // clearInterval(getSongListEInterval);
            })();
        }, 100);

        GM_addStyle(`a, blockquote, body, code, dd, div, dl, dt, embed, fieldset, footer, form, h1, h2, h3, h4, h5, h6, header, html, img, legend, li, ol, p, pre, section, table, td, th, ul {
    -webkit-user-drag: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}`);
        GM_addStyle(`html .side-panel[role=complementary] {
    right: 20px !important;
}`);

    }, false);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址