WebhookInspect

Webhook 调试器

Webhook URL
总请求 0
今日 0
请求日志 0 条
暂无请求记录
请求详情
点击左侧日志条目查看详情
(function() { // Polyfill crypto.randomUUID if missing if (typeof crypto !== 'undefined' && typeof crypto.randomUUID !== 'function') { crypto.randomUUID = function() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); }; } // Fallback for environments where crypto is completely absent (rare) if (typeof crypto === 'undefined') { window.crypto = { randomUUID: function() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } }; } })(); // Global error handler: catch any unhandled exceptions and log them, prevent page from breaking window.addEventListener('error', function(e) { // Resource load error (script, link, img) if (e.target && (e.target.tagName === 'SCRIPT' || e.target.tagName === 'LINK' || e.target.tagName === 'IMG')) { console.warn('[WebhookInspect] Resource failed to load:', e.target.src || e.target.href); return; } // Regular runtime error console.error('[WebhookInspect] Uncaught error:', e.error || e.message); // Optionally show a toast for critical errors? Not needed now. }, true); // Also catch promise rejections window.addEventListener('unhandledrejection', function(e) { console.warn('[WebhookInspect] Unhandled promise rejection:', e.reason); }); // Override generateId to use the polyfill (in case the original function was already called with undefined crypto) document.addEventListener('DOMContentLoaded', function() { if (typeof window.generateId === 'function') { var origGenerateId = window.generateId; window.generateId = function() { try { return 'wh_' + crypto.randomUUID().slice(0, 8) + Math.random().toString(36).substring(2, 6); } catch (_) { return 'wh_' + Date.now().toString(36) + Math.random().toString(36).substring(2, 8); } }; } });