整合自定义 json

This commit is contained in:
2025-10-26 02:32:51 +08:00
parent 249aeb0dc2
commit b38c5d451d
6 changed files with 290 additions and 28 deletions

View File

@@ -17,6 +17,24 @@ try {
console.error("[Monaco] loader.config failed:", e);
}
// 全局捕获未处理的Promise拒绝防止Monaco Editor错误
window.addEventListener('unhandledrejection', (event) => {
const error = event.reason;
if (error && error.message && error.message.includes('URL is not valid')) {
event.preventDefault();
console.warn('[Monaco] Suppressed URL validation error:', error);
}
});
// 全局捕获window.onerror
window.addEventListener('error', (event) => {
if (event.error && event.error.message && event.error.message.includes('URL is not valid')) {
console.warn('[Monaco] Suppressed URL validation error:', event.error);
event.preventDefault();
return true;
}
});
// Initialize analytics before rendering (will no-op if no consent or no key)
analytics.initialize();