fix: anti-detection

This commit is contained in:
Xmader 2020-11-05 17:32:27 -05:00
parent f9b137c866
commit 49c42eeda9
1 changed files with 11 additions and 10 deletions

View File

@ -58,16 +58,17 @@ export class BtnList {
// 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) },
get: () => { get: () => {
// first time only // first time only
const t = this.antiDetectionText const t = this.antiDetectionText
this.antiDetectionText = ' ' this.antiDetectionText = ' '
return t return t
}, },
})
}) })
// hide this button from Array.prototype.filter // hide this button from Array.prototype.filter
this.hide(btn) this.hide(btn)