desktop: the notification plugin's refused is_permission_granted probe at page load (macOS, Linux; the webview has no plugin API) is no longer logged as a start error in webview.log

This commit is contained in:
CRTkafa 2026-10-13 02:03:51 +08:00
parent 7901beee1e
commit 2e66aa42b6
3 changed files with 23 additions and 1 deletions

View file

@ -118,7 +118,11 @@
if (t && t !== window && (t.src || t.href)) { record('load', 'could not load ' + (t.src || t.href)); return; }
record('window.onerror', ev.error || ev.message, ev.error && ev.error.stack);
}, true);
// tauri-plugin-notification's init script asks for the notification permission at load (macOS, Linux); the webview
// has no plugin API by design (capabilities/main.json), so that call is refused: expected, not an error
function pluginProbe(e) { return /plugin:notification\|is_permission_granted not allowed/.test(text(e)); }
window.addEventListener('unhandledrejection', function (ev) {
if (pluginProbe(ev.reason)) { ev.preventDefault(); return; }
if (!booted()) record('unhandledrejection', ev.reason, ev.reason && ev.reason.stack);
});
// React's root reports an error no boundary caught (the tree is gone) here: src/main.tsx onUncaughtError