虫虫钢琴铺面查看脚本

虫虫钢琴铺面查看工具,可点击下载,全屏,打印等功能。

// ==UserScript==
// @name         虫虫钢琴铺面查看脚本
// @namespace    TesterNaN.github.io
// @version      1.3
// @description  虫虫钢琴铺面查看工具,可点击下载,全屏,打印等功能。
// @author       TesterNaN
// @license      GPLv3
// @match        *://www.gangqinpu.com/jianpu/*
// @match        *://www.gangqinpu.com/cchtml/*
// @match        *://www.gangqinpu.com/sheetplayer/web.html?*
// @icon         https://www.gangqinpu.com/favicon.ico
// @grant        none
// ==/UserScript==

function CrackMain(){
    try{
        var kj=document.getElementById("ai-score");
    }catch(e){
        alert("抱歉,您当前查看的谱面暂时无法读取");
        return -1;
    };
    var btn1=document.querySelector(".down.download");
    var btn2=document.getElementById("s_d_fullBtn");
    var btn3=document.querySelector(".print.Printing");
    var tojp=document.querySelector(".jianpu-btn");
    setTimeout(function(){
        try{
            document.querySelector("#line-spectrum-box > div.ai > div").style.visibility="hidden";
        }catch(e){}
        try{
            document.querySelector(".s-d-m-b-buy").style.visibility="hidden";
        }catch(e){}
        try{
        //document.querySelector(".no-buy.active > div.img-mask").style.visibility="hidden";
            document.querySelector("#line-spectrum-box > div.defalut.no-buy.active > div.img-mask").style.visibility="hidden";
        }catch(e){}
        try{
            document.querySelector("#line-spectrum-box > div.ai").style.display='block';
        }catch(e){}
        try{
            document.querySelector("#line-spectrum-box > div.defalut.no-buy.active").style.display="none";
        }catch(e){}
        try{
            document.querySelector("#siwper1-middle-play").style.display="none";
        }catch(e){}
        try{
            document.querySelector("#ai-score").scrolling="yes";
        }catch(e){}
        try{
            document.querySelector("#header > div.content-box-0").style.display="none";
        }catch(e){}
    }, 1000);
    btn1.addEventListener("click",function(){
        window.open(kj.src);
        event.stopImmediatePropagation();
    },true);
    btn2.addEventListener("click",function(){
        window.open(kj.src);
        event.stopImmediatePropagation();
    },true);
    btn3.addEventListener("click",function(){
        //window.open(kj.src);
        document.getElementById('ai-score').contentWindow.window.print();
        event.stopImmediatePropagation();
    },true);
    try{
    tojp.addEventListener("click",function(){
        var str = window.location.pathname;
        if(str.includes("/jianpu/")){
            window.open("https://www.gangqinpu.com/cchtml"+str.substring(7));
        }else{
            window.open("https://www.gangqinpu.com/jianpu"+str.substring(7));
        }
        event.stopImmediatePropagation();
    },true);
    }catch(e){};
    console.log("破解全屏和下载完毕");
    return 0;
}

(function() {
    'use strict';
    var str = window.location.pathname;
    if(str.includes("/jianpu/") || str.includes("/cchtml/")){
	    CrackMain();
    }else{
        !document.referrer&&(location.href+="");
        setTimeout(function(){
            document.querySelector("#page_0 > g.qrcode.print").style.display='none';
            document.querySelector("#page_0 > g:nth-child(1) > image").style.visibility="hidden";
            document.querySelector("#page_0 > g.footer > text.print").style.visibility="hidden";
            for(var i=1;i<=document.querySelector("#svg").children.length-3;i++){
                document.querySelector("#page_"+i+" > g.print > image").style.visibility="hidden";
                document.querySelector("#page_"+i+" > g.footer > text.print").style.visibility="hidden";
            }
            console.log("去除水印完毕");
        }, 3000);

    }
})();