pull/1686/head
lyswhut 2023-11-09 00:19:07 +08:00
parent 887cf39321
commit 182f08d221
1 changed files with 12 additions and 0 deletions

View File

@ -314,6 +314,18 @@ window.addEventListener('unhandledrejection', (event) => {
const message = typeof event.reason === 'string' ? event.reason : event.reason?.message ?? String(event.reason)
globalThis.__lx_init_error_handler__.sendError(message.replace(/^Error:\\s/, ''))
})
Object.defineProperty(window.document, 'getElementsByTagName', {
value: (name) => {
if (name == 'script') {
return [
Object.freeze({
innerText: lx.currentScriptInfo.rawScript,
}),
]
}
return null
}
})
})()`)
webFrame.executeJavaScript(userApi.script).catch(_ => _)