You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
add: window.onerror event
This commit is contained in:
@@ -171,6 +171,7 @@ androidComponents.onVariants { variant ->
|
||||
set.add(Pair(root.file("webroot/js/restoreError.js").asFile, null))
|
||||
set.add(Pair(root.file("webroot/js/navbar.js").asFile, null))
|
||||
set.add(Pair(root.file("webroot/js/daemon_actions.js").asFile, null))
|
||||
set.add(Pair(root.file("webroot/js/errorCatcher.js").asFile, null))
|
||||
|
||||
set.add(Pair(root.file("webroot/js/translate/action.js").asFile, null))
|
||||
set.add(Pair(root.file("webroot/js/translate/home.js").asFile, null))
|
||||
|
||||
@@ -122,6 +122,7 @@ extract "$ZIPFILE" 'webroot/js/language.js' "$MODPATH/webroot/js" true
|
||||
extract "$ZIPFILE" 'webroot/js/navbar.js' "$MODPATH/webroot/js" true
|
||||
extract "$ZIPFILE" 'webroot/js/restoreError.js' "$MODPATH/webroot/js" true
|
||||
extract "$ZIPFILE" 'webroot/js/daemon_actions.js' "$MODPATH/webroot/js" true
|
||||
extract "$ZIPFILE" 'webroot/js/errorCatcher.js' "$MODPATH/webroot/js" true
|
||||
|
||||
extract "$ZIPFILE" 'webroot/js/translate/home.js' "$MODPATH/webroot/js/translate" true
|
||||
extract "$ZIPFILE" 'webroot/js/translate/action.js' "$MODPATH/webroot/js/translate" true
|
||||
|
||||
BIN
webroot.zip
Normal file
BIN
webroot.zip
Normal file
Binary file not shown.
@@ -6,6 +6,7 @@
|
||||
<meta name="viewport" content="viewport-fit=cover" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<script src="js/errorCatcher.js" type="module"></script>
|
||||
<script src="js/theme.js" type="module"></script>
|
||||
<script src="js/restoreError.js" type="module"></script>
|
||||
<script src="js/navbar.js" type="module"></script>
|
||||
@@ -22,7 +23,7 @@
|
||||
<body id="main_body">
|
||||
<!-- INFO: Loading screen -->
|
||||
<div id="loading_screen" class="load_screen">
|
||||
<div class="loader"></div>
|
||||
<div id="backport_errorh" class="loader"></div>
|
||||
</div>
|
||||
|
||||
<!-- INFO: Language Modal -->
|
||||
|
||||
16
webroot/js/errorCatcher.js
Normal file
16
webroot/js/errorCatcher.js
Normal file
@@ -0,0 +1,16 @@
|
||||
function setError(place, issue) {
|
||||
const fullErrorLog = setErrorData(`${place}: ${issue}`)
|
||||
document.getElementById('errorh_panel').innerHTML = fullErrorLog
|
||||
}
|
||||
|
||||
function setErrorData(errorLog) {
|
||||
const getPrevious = localStorage.getItem('/system/error')
|
||||
const finalLog = getPrevious && getPrevious.length !== 0 ? getPrevious + `\n` + errorLog : errorLog
|
||||
|
||||
localStorage.setItem('/system/error', finalLog)
|
||||
return finalLog
|
||||
}
|
||||
|
||||
if (window.onerror) window.onerror = (err) => {
|
||||
setError('WebUI', err.stack ? err.stack : err.message)
|
||||
}
|
||||
@@ -21,8 +21,6 @@ function setErrorData(errorLog) {
|
||||
return finalLog
|
||||
}
|
||||
|
||||
if (window.onerror) window.onerror = (err) => setError('WebUI', err.stack ? err.stack : err.message)
|
||||
|
||||
(async () => {
|
||||
const EXPECTED = 1
|
||||
const UNEXPECTED_FAIL = 2
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const button = document.getElementById('rezygisk_errorh')
|
||||
const backport = document.getElementById('backport_errorh')
|
||||
const copy_button = document.getElementById('errorh_copy')
|
||||
const target = document.getElementById('errorh_modal')
|
||||
const close_button = document.getElementById('errorh_modal_close')
|
||||
@@ -14,6 +15,18 @@ button.addEventListener('click', () => {
|
||||
sys_module_mode = setData('opened')
|
||||
})
|
||||
|
||||
backport.addEventListener('click', () => {
|
||||
if (sys_module_mode == 'opened') {
|
||||
target.style.top = '100%'
|
||||
sys_module_mode = setData('closed')
|
||||
return
|
||||
}
|
||||
|
||||
target.style.top = '0%'
|
||||
sys_module_mode = setData('opened')
|
||||
})
|
||||
|
||||
|
||||
close_button.addEventListener('click', () => {
|
||||
target.style.top = '100%'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user