完善报错信息
This commit is contained in:
@@ -80,6 +80,20 @@
|
||||
observer.observe(document.documentElement, { childList: true, subtree: true });
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
// Global Error Logger for remote debugging
|
||||
window.onerror = function(msg, url, line, col, error) {
|
||||
var debugDiv = document.getElementById('js-debug-overlay');
|
||||
if (!debugDiv) {
|
||||
debugDiv = document.createElement('div');
|
||||
debugDiv.id = 'js-debug-overlay';
|
||||
debugDiv.style.cssText = 'position:fixed;top:0;left:0;width:100%;background:rgba(220,38,38,0.95);color:white;z-index:99999;padding:10px;font-family:monospace;font-size:12px;max-height:30vh;overflow:auto;pointer-events:none;';
|
||||
document.body.appendChild(debugDiv);
|
||||
}
|
||||
debugDiv.innerHTML += '<div>[JS ERROR] ' + msg + ' at ' + line + ':' + col + '</div>';
|
||||
return false;
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user