This commit is contained in:
Xmader 2020-11-06 02:06:10 -05:00
parent a48fa33ea2
commit e00dcc36eb
3 changed files with 23 additions and 17 deletions

14
dist/main.js vendored
View File

@ -5,7 +5,7 @@
// @supportURL https://github.com/Xmader/musescore-downloader/issues // @supportURL https://github.com/Xmader/musescore-downloader/issues
// @updateURL https://msdl.librescore.org/install.user.js // @updateURL https://msdl.librescore.org/install.user.js
// @downloadURL https://msdl.librescore.org/install.user.js // @downloadURL https://msdl.librescore.org/install.user.js
// @version 0.11.2 // @version 0.11.3
// @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro免费下载 musescore.com 上的曲谱 // @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro免费下载 musescore.com 上的曲谱
// @author Xmader // @author Xmader
// @match https://musescore.com/*/* // @match https://musescore.com/*/*
@ -26455,12 +26455,12 @@ Please pipe the document into a Node stream.\
} }
return _toString.call(this); return _toString.call(this);
}; };
}); }, true);
return (fn) => { return (fn) => {
l.add(fn); l.add(fn);
}; };
})(); })();
function hookNative(target, method, hook) { function hookNative(target, method, hook, async = false) {
// reserve for future hook update // reserve for future hook update
const _fn = target[method]; const _fn = target[method];
const detach = () => { const detach = () => {
@ -26470,10 +26470,15 @@ Please pipe the document into a Node stream.\
// so setting this function to be non-configurable and non-writable is no use. // so setting this function to be non-configurable and non-writable is no use.
const hookedFn = hook(_fn, detach); const hookedFn = hook(_fn, detach);
target[method] = hookedFn; target[method] = hookedFn;
if (!async) {
makeNative(hookedFn);
}
else {
setTimeout(() => { setTimeout(() => {
makeNative(hookedFn); makeNative(hookedFn);
}); });
} }
}
const hideFromArrFilter = (() => { const hideFromArrFilter = (() => {
const l = new Set(); const l = new Set();
hookNative(Array.prototype, 'filter', (_filter) => { hookNative(Array.prototype, 'filter', (_filter) => {
@ -26780,7 +26785,7 @@ Please pipe the document into a Node stream.\
// Anti-detection: // Anti-detection:
// musescore will send a track event "MSCZDOWNLOADER_INSTALLED" to its backend // musescore will send a track event "MSCZDOWNLOADER_INSTALLED" to its backend
// if detected "Download MSCZ" // if detected "Download MSCZ"
const _property = 'textContent'; ['textContent', 'innerHTML'].forEach((_property) => {
const _set = textNode['__lookupSetter__'](_property); const _set = textNode['__lookupSetter__'](_property);
Object.defineProperty(textNode, _property, { Object.defineProperty(textNode, _property, {
set(v) { _set.call(textNode, v); }, set(v) { _set.call(textNode, v); },
@ -26791,6 +26796,7 @@ Please pipe the document into a Node stream.\
return t; return t;
}, },
}); });
});
// hide this button from Array.prototype.filter // hide this button from Array.prototype.filter
this.hide(btn); this.hide(btn);
this.hide(textNode); this.hide(textNode);

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "musescore-downloader", "name": "musescore-downloader",
"version": "0.11.2", "version": "0.11.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "musescore-downloader", "name": "musescore-downloader",
"version": "0.11.2", "version": "0.11.3",
"description": "download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro免费下载 musescore.com 上的曲谱", "description": "download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro免费下载 musescore.com 上的曲谱",
"main": "dist/main.js", "main": "dist/main.js",
"repository": { "repository": {