diff --git a/dist/main.js b/dist/main.js index 55d9312..953a33c 100644 --- a/dist/main.js +++ b/dist/main.js @@ -5,7 +5,7 @@ // @supportURL https://github.com/Xmader/musescore-downloader/issues // @updateURL https://msdl.librescore.org/install.user.js // @downloadURL https://msdl.librescore.org/install.user.js -// @version 0.23.11 +// @version 0.23.12 // @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱 // @author Xmader // @match https://musescore.com/*/* @@ -54,10 +54,11 @@ // script loader new Promise(resolve => { - const id = '' + Math.random(); - w[id] = resolve; - - const stackN = 9 + const d = new Image() + document.body.prepend(d) + resolve(d) + }).then(d => { + const stackN = 10 let loaderIntro = '' for (let i = 0; i < stackN; i++) { loaderIntro += `(function ${getRandL()}(){` @@ -65,12 +66,10 @@ const loaderOutro = '})()'.repeat(stackN) const mockUrl = "https://c.amazon-adsystem.com/aax2/apstag.js" - setTimeout(`${loaderIntro}const d=new Image();window['${id}'](d);delete window['${id}'];document.body.prepend(d)${loaderOutro}//# sourceURL=${mockUrl}`) - }).then(d => { d.style.display = 'none'; d.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; d.once = false; - d.setAttribute('onload', `if(this.once)return;this.once=true;this.remove();const GM=window['${gmId}'];delete window['${gmId}'];(` + function a () { + d.setAttribute('onload', `const self=this;${loaderIntro}if(self.once)return;self.once=true;self.remove();const GM=window['${gmId}'];delete window['${gmId}'];(` + function a () { /** script code here */ @@ -27514,6 +27513,6 @@ Please pipe the document into a Node stream.\ // eslint-disable-next-line @typescript-eslint/no-floating-promises waitForSheetLoaded().then(main); - }.toString() + ')()')}) + }.toString() + `)()${loaderOutro}//# sourceURL=${mockUrl}`)}) }()); diff --git a/package-lock.json b/package-lock.json index 07d2ee5..5ccbe12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "musescore-downloader", - "version": "0.23.11", + "version": "0.23.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 38dcd13..7bf0dff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "musescore-downloader", - "version": "0.23.11", + "version": "0.23.12", "description": "download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱", "main": "dist/main.js", "bin": "dist/cli.js",