refactor: solve anti-debug
This commit is contained in:
parent
704770780d
commit
5cefd2081d
5 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
|
||||
import { loadMscore, WebMscore } from './mscore'
|
||||
import { useTimeout, windowOpen } from './utils'
|
||||
import { useTimeout, windowOpen, console } from './utils'
|
||||
import i18n from './i18n'
|
||||
// @ts-ignore
|
||||
import btnListCss from './btn.css'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import './meta'
|
||||
|
||||
import { waitForDocumentLoaded, saveAs } from './utils'
|
||||
import { waitForDocumentLoaded, saveAs, console } from './utils'
|
||||
import { downloadPDF } from './pdf'
|
||||
import { downloadMscz } from './mscz'
|
||||
import { getFileUrl } from './file'
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
|
||||
import { console } from './utils'
|
||||
|
||||
// run at document-start
|
||||
export const ugappJsStore: Record<string, any> | null = (() => {
|
||||
try {
|
||||
|
|
|
@ -44,6 +44,8 @@ export const windowOpen: Window['open'] = (...args): Window | null => {
|
|||
return getSandboxWindow().open(...args)
|
||||
}
|
||||
|
||||
export const console: Console = getSandboxWindow()['console']
|
||||
|
||||
export const waitForDocumentLoaded = (): Promise<void> => {
|
||||
if (document.readyState !== 'complete') {
|
||||
return new Promise(resolve => {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
|
||||
import { hookNative } from './anti-detection'
|
||||
import { console } from './utils'
|
||||
|
||||
const CHUNK_PUSH_FN = /^function [^r]\(\w\){/
|
||||
|
||||
|
|
Loading…
Reference in a new issue