Greasy Fork

Greasy Fork is available in English.

Userscript Helper for Netease Music Flat Userstyle

Provides a better experience for Netease Music Flat Userstyle.

当前为 2018-06-26 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name   Userscript Helper for Netease Music Flat Userstyle
// @name:zh-CN         网易云音乐扁平用户样式辅助用户脚本
// @namespace    undefined
// @version      0.0.1.1-0.3.5.8
// @description  Provides a better experience for Netease Music Flat Userstyle.
// @description:zh-CN  为网易云音乐扁平用户样式提供更佳的用户体验。
// @author       wTonyChen
// @match        http*://music.163.com/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
 "use strict";
document.documentElement.setAttribute("wk-style-assist", "true");
let mainEvent = e => {
    let alt_imgs = document.querySelectorAll("img[data-src]");
    for ( let i = 0; i < alt_imgs; i ++ ) {
        if (alt_imgs[i].dataset.src && alt_imgs[i].src == "") alt_imgs[i].src = alt_imgs[i].dataset.src;
    }
    let imgs = window.document.images;
    for ( let i = 0; i < imgs.length; i ++ ) {
        let base = imgs[i].src.split("?")[0];
        if (imgs[i].src != base) imgs[i].src = base;
    }
    if (location.pathname.indexOf("/user/") == 0) {
        let user_pic = document.querySelector(".m-proifo dt img"), container = document.querySelector(".g-bd");
        if (user_pic && user_pic.src && container) (document.documentElement.classList.add("has-upb"), container.style.cssText = `--upb: url("${user_pic.src}")`);
   }
   let cover_img = document.querySelector(".g-wrap > .m-info .cover img"), con = document.querySelector(".g-wrap > .m-info");
   if (cover_img && con) (document.documentElement.classList.add("has-mib"), con.style.cssText = `--mib: url("${cover_img.src}")`);
}
mainEvent();
window.setInterval(mainEvent, 2000);
})();