fix: anti-detection

This commit is contained in:
Xmader 2020-11-06 12:37:32 -05:00
parent 763c592dc2
commit 06dd28f515
No known key found for this signature in database
GPG key ID: A20B97FB9EB730E4

View file

@ -51,13 +51,15 @@ export function hookNative<T extends object, M extends (keyof T)> (
export const hideFromArrFilter = (() => { export const hideFromArrFilter = (() => {
const l = new Set() const l = new Set()
hookNative(Array.prototype, 'filter', (_filter) => { const qsaHook = (_fn) => {
return function (...args) { return function (...args) {
const arr = _filter.apply(this, args) const arr = _fn.apply(this, args)
// eslint-disable-next-line @typescript-eslint/no-unsafe-return // eslint-disable-next-line @typescript-eslint/no-unsafe-return
return _filter.call(arr, (e) => !l.has(e)) return Array.prototype.filter.call(arr, (e) => !l.has(e))
} }
}) }
hookNative(Element.prototype, 'querySelectorAll', qsaHook)
hookNative(document, 'querySelectorAll', qsaHook)
return (item: any) => { return (item: any) => {
l.add(item) l.add(item)