|
5 | 5 | // @supportURL https://github.com/Xmader/musescore-downloader/issues
|
6 | 6 | // @updateURL https://msdl.librescore.org/install.user.js
|
7 | 7 | // @downloadURL https://msdl.librescore.org/install.user.js
|
8 |
| -// @version 0.23.11 |
| 8 | +// @version 0.23.12 |
9 | 9 | // @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱
|
10 | 10 | // @author Xmader
|
11 | 11 | // @match https://musescore.com/*/*
|
|
54 | 54 |
|
55 | 55 | // script loader
|
56 | 56 | new Promise(resolve => {
|
57 |
| - const id = '' + Math.random(); |
58 |
| - w[id] = resolve; |
59 |
| - |
60 |
| - const stackN = 9 |
| 57 | + const d = new Image() |
| 58 | + document.body.prepend(d) |
| 59 | + resolve(d) |
| 60 | + }).then(d => { |
| 61 | + const stackN = 10 |
61 | 62 | let loaderIntro = ''
|
62 | 63 | for (let i = 0; i < stackN; i++) {
|
63 | 64 | loaderIntro += `(function ${getRandL()}(){`
|
64 | 65 | }
|
65 | 66 | const loaderOutro = '})()'.repeat(stackN)
|
66 | 67 | const mockUrl = "https://c.amazon-adsystem.com/aax2/apstag.js"
|
67 | 68 |
|
68 |
| - setTimeout(`${loaderIntro}const d=new Image();window['${id}'](d);delete window['${id}'];document.body.prepend(d)${loaderOutro}//# sourceURL=${mockUrl}`) |
69 |
| - }).then(d => { |
70 | 69 | d.style.display = 'none';
|
71 | 70 | d.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
|
72 | 71 | d.once = false;
|
73 |
| - d.setAttribute('onload', `if(this.once)return;this.once=true;this.remove();const GM=window['${gmId}'];delete window['${gmId}'];(` + function a () { |
| 72 | + 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 () { |
74 | 73 | /** script code here */
|
75 | 74 |
|
76 | 75 |
|
@@ -27514,6 +27513,6 @@ Please pipe the document into a Node stream.\
|
27514 | 27513 | // eslint-disable-next-line @typescript-eslint/no-floating-promises
|
27515 | 27514 | waitForSheetLoaded().then(main);
|
27516 | 27515 |
|
27517 |
| - }.toString() + ')()')}) |
| 27516 | + }.toString() + `)()${loaderOutro}//# sourceURL=${mockUrl}`)}) |
27518 | 27517 |
|
27519 | 27518 | }());
|
0 commit comments