复制spotify歌曲名

打印出网页中spotify的歌曲名,以复制

当前为 2018-11-30 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        复制spotify歌曲名
// @name:zh     复制spotify歌曲名
// @name:en     print(copy) spotify song names
// @namespace   https://greasyfork.org/users/129338
// @version      0.1
// @description  打印出网页中spotify的歌曲名,以复制
// @description:en  print song names of spotify's playlist.
// @author       Jeffrey.Deng
// @match        http://open.spotify.com/*
// @match        https://open.spotify.com/*
// ==/UserScript==

// @weibo       http://weibo.com/3983281402
// @blog        https://imcoder.site

(function() {
    'use strict';

    // Your code here...
    var printList = function () {
        var nodes = document.querySelector("#main > div > div.Root__top-container > div.Root__main-view.Root__main-view--has-upsell-bar > div > div > div > section > div > div > div.col-xs-12.col-lg-9.col-xl-8 > section > ol").querySelectorAll("div > li > div.tracklist-col.name > div > div");
        for (var node of nodes) {
            node && console.log(node.innerText);
        }
    }
    unsafeWindow.printList = printList;
    console.log("Now, you can type \"printList();\" in console, then get the song names");
})();