playlists buttons

Adds Buttons to your favorite playlists.

目前為 2022-08-05 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         playlists buttons
// @version      1.2
// @description  Adds Buttons to your favorite playlists.
// @author       Bliwi
// @match        https://soundcloud.com/*
// @grant        none
// @run-at       document-end
// @noframes
// @license MIT
// @namespace https://greasyfork.org/users/943433
// ==/UserScript==

(function() {
    'use strict';

    /* Injects Button into the page once it has loaded,
       then tries to re-add it if it disappears due to page change
    */
    function playlistsLoad() {
        insertButton('Subscribe!','PLAYLIST LINK');
        insertButton('Bangers','PLAYLIST LINK');
        insertButton('Favorites','PLAYLIST LINK');
        insertButton('Wowk and Focus','PLAYLIST LINK');
        insertButton('Anime Music','PLAYLIST LINK');
    }
    setTimeout(playlistsLoad, 500);
    function insertButton(playlistname,playlistlink) {
        let playlist = document.createElement('Button');
        let header = document.querySelector('.header__middle');
        playlist.innerHTML = playlistname;
        playlist.onclick = function(){location.href = playlistlink;};
        playlist.className = 'playlist-button';
        if (header) {
        header.insertBefore(playlist, header.children[2]);

    } else {setTimeout(playlistsLoad, 1000);}
    }
})();