fix: anti-detection (#47)

This commit is contained in:
Xmader 2020-11-05 11:31:38 -05:00
parent cb0a85b8b2
commit 9ba244b519
1 changed files with 8 additions and 1 deletions

View File

@ -40,6 +40,8 @@ export class BtnList {
constructor (private templateBtn: BtnElement) { }
private antiDetectionText = 'Download'
add (options: BtnOptions): BtnElement {
const btn = this.templateBtn.cloneNode(true) as HTMLButtonElement
@ -55,7 +57,12 @@ export class BtnList {
const _set = textNode['__lookupSetter__'](_property)
Object.defineProperty(textNode, _property, {
set (v) { _set.call(textNode, v) },
get () { return 'Download' },
get: () => {
// first time only
const t = this.antiDetectionText
this.antiDetectionText = ''
return t
},
})
const setText = (str: string): void => {