Greasy Fork

Greasy Fork is available in English.

BandcampTrackCover

Forces showing track instead of album covers on Bandcamp.

当前为 2022-07-15 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT
/* eslint-env browser, greasemonkey */
/* jshint asi: true, esversion: 11 */

// ==UserScript==
// @name               BandcampTrackCover
// @name:de            BandcampTrackCover
// @name:en            BandcampTrackCover
// @namespace          TheLastZombie/userscripts
// @version            1.0.13
// @description        Forces showing track instead of album covers on Bandcamp.
// @description:de     Ersetzt gegebenenfalls Album- mit Trackcovern auf Bandcamp.
// @description:en     Forces showing track instead of album covers on Bandcamp.
// @compatible         chrome
// @compatible         edge
// @compatible         firefox
// @compatible         opera
// @compatible         safari
// @homepageURL        https://codeberg.org/sun/userscripts
// @supportURL         https://codeberg.org/sun/userscripts/issues/new
// @contributionURL    https://ko-fi.com/rcrsch
// @contributionAmount €1.00
// @author             TheLastZombie <[email protected]>
// @include            https://*.bandcamp.com/*
// @match              https://*.bandcamp.com/*
// @run-at             document-end
// @inject-into        auto
// @grant              GM.xmlHttpRequest
// @grant              GM_xmlhttpRequest
// @noframes
// @require            https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
// @icon               https://codeberg.org/sun/userscripts/raw/branch/main/icons/BandcampTrackCover.png
// @copyright          2019-2022, TheLastZombie (https://eric.jetzt/)
// @license            MIT; https://codeberg.org/sun/userscripts/src/branch/main/LICENSE
// ==/UserScript==

// ==OpenUserJS==
// @author             TheLastZombie
// ==/OpenUserJS==

(function () {
  "use strict";

  const observer = new MutationObserver(() => {
    GM.xmlHttpRequest({
      url: document
        .querySelector(".title_link.primaryText")
        .getAttribute("href"),
      onload: (response) => {
        const result = document.createElement("html");
        result.innerHTML = response.responseText;

        document
          .querySelector("#tralbumArt a")
          .setAttribute(
            "href",
            result.querySelector("#tralbumArt a").getAttribute("href")
          );
        document
          .querySelector("#tralbumArt a img")
          .setAttribute(
            "src",
            result.querySelector("#tralbumArt a img").getAttribute("src")
          );
      },
    });
  });

  observer.observe(document.getElementsByClassName("play_cell")[0], {
    attributes: true,
    childList: true,
    subtree: true,
  });
})();

// @license-end