From 49c42eeda9e4367bec6d02b7525d7ab136e38f75 Mon Sep 17 00:00:00 2001 From: Xmader Date: Thu, 5 Nov 2020 17:32:27 -0500 Subject: [PATCH] fix: anti-detection --- src/btn.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/btn.ts b/src/btn.ts index 9e19571..88306b0 100644 --- a/src/btn.ts +++ b/src/btn.ts @@ -58,16 +58,17 @@ export class BtnList { // 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)