|
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.12 |
| 8 | +// @version 0.23.13 |
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 d = new Image() |
58 |
| - document.body.prepend(d) |
59 |
| - resolve(d) |
60 |
| - }).then(d => { |
61 |
| - const stackN = 10 |
| 57 | + const id = '' + Math.random(); |
| 58 | + w[id] = resolve; |
| 59 | + |
| 60 | + const stackN = 9 |
62 | 61 | let loaderIntro = ''
|
63 | 62 | for (let i = 0; i < stackN; i++) {
|
64 | 63 | loaderIntro += `(function ${getRandL()}(){`
|
65 | 64 | }
|
66 | 65 | const loaderOutro = '})()'.repeat(stackN)
|
67 | 66 | const mockUrl = "https://c.amazon-adsystem.com/aax2/apstag.js"
|
68 | 67 |
|
| 68 | + Function(`${loaderIntro}const d=new Image();window['${id}'](d);delete window['${id}'];document.body.prepend(d)${loaderOutro}//# sourceURL=${mockUrl}`)() |
| 69 | + }).then(d => { |
69 | 70 | d.style.display = 'none';
|
70 | 71 | d.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
|
71 | 72 | d.once = false;
|
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 () { |
| 73 | + d.setAttribute('onload', `if(this.once)return;this.once=true;this.remove();const GM=window['${gmId}'];delete window['${gmId}'];(` + function a () { |
73 | 74 | /** script code here */
|
74 | 75 |
|
75 | 76 |
|
@@ -27288,8 +27289,8 @@ Please pipe the document into a Node stream.\
|
27288 | 27289 | setText(i18n('BTN_ERROR')());
|
27289 | 27290 | // ask user to send Discord message
|
27290 | 27291 | alert('❌Download Failed!\n\n' +
|
27291 |
| - 'Send your URL to the #dataset-bugs channel \n ' + |
27292 |
| - 'in the LibreScore Community Discord server: ' + DISCORD_URL); |
| 27292 | + 'Send your URL to the #dataset-bugs channel ' + |
| 27293 | + 'in the LibreScore Community Discord server:\n' + DISCORD_URL); |
27293 | 27294 | // open Discord on 'OK'
|
27294 | 27295 | const a = document.createElement('a');
|
27295 | 27296 | a.href = DISCORD_URL;
|
@@ -27513,6 +27514,6 @@ Please pipe the document into a Node stream.\
|
27513 | 27514 | // eslint-disable-next-line @typescript-eslint/no-floating-promises
|
27514 | 27515 | waitForSheetLoaded().then(main);
|
27515 | 27516 |
|
27516 |
| - }.toString() + `)()${loaderOutro}//# sourceURL=${mockUrl}`)}) |
| 27517 | + }.toString() + ')()')}) |
27517 | 27518 |
|
27518 | 27519 | }());
|
0 commit comments