From e00dcc36ebd459ca821716301ad2e6127c29e461 Mon Sep 17 00:00:00 2001 From: Xmader Date: Fri, 6 Nov 2020 02:06:10 -0500 Subject: [PATCH] v0.11.3 --- dist/main.js | 36 +++++++++++++++++++++--------------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/dist/main.js b/dist/main.js index 5c3ee84..eafd68c 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.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 上的曲谱 // @author Xmader // @match https://musescore.com/*/* @@ -26455,12 +26455,12 @@ Please pipe the document into a Node stream.\ } return _toString.call(this); }; - }); + }, true); return (fn) => { l.add(fn); }; })(); - function hookNative(target, method, hook) { + function hookNative(target, method, hook, async = false) { // reserve for future hook update const _fn = target[method]; const detach = () => { @@ -26470,9 +26470,14 @@ Please pipe the document into a Node stream.\ // so setting this function to be non-configurable and non-writable is no use. const hookedFn = hook(_fn, detach); target[method] = hookedFn; - setTimeout(() => { + if (!async) { makeNative(hookedFn); - }); + } + else { + setTimeout(() => { + makeNative(hookedFn); + }); + } } const hideFromArrFilter = (() => { const l = new Set(); @@ -26780,16 +26785,17 @@ Please pipe the document into a Node stream.\ // Anti-detection: // musescore will send a track event "MSCZDOWNLOADER_INSTALLED" to its backend // if detected "Download MSCZ" - const _property = 'textContent'; - const _set = textNode['__lookupSetter__'](_property); - Object.defineProperty(textNode, _property, { - set(v) { _set.call(textNode, v); }, - get: () => { - // first time only - const t = this.antiDetectionText; - this.antiDetectionText = ' '; - return t; - }, + ['textContent', 'innerHTML'].forEach((_property) => { + const _set = textNode['__lookupSetter__'](_property); + Object.defineProperty(textNode, _property, { + set(v) { _set.call(textNode, v); }, + get: () => { + // first time only + const t = this.antiDetectionText; + this.antiDetectionText = ' '; + return t; + }, + }); }); // hide this button from Array.prototype.filter this.hide(btn); diff --git a/package-lock.json b/package-lock.json index 58dee8a..de03bd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "musescore-downloader", - "version": "0.11.2", + "version": "0.11.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3f35eb1..6a69e02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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 上的曲谱", "main": "dist/main.js", "repository": {