diff --git a/src/app.tsx b/src/app.tsx index c1562d0..0afcc90 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -174,7 +174,7 @@ function AppLayout(props: { children: any }) { >
{ + // Prevent iframe errors from bubbling up + const handleError = (e: ErrorEvent) => { + if (e.filename?.includes("resume.pdf") || e.message === "Script error.") { + e.preventDefault(); + e.stopPropagation(); + } + }; + + window.addEventListener("error", handleError, true); + + onCleanup(() => { + window.removeEventListener("error", handleError, true); + + // Clear iframe source before unmount to prevent script errors + if (iframeRef) { + iframeRef.src = "about:blank"; + } + }); + }); + return ( <> Resume | Michael Freno @@ -13,6 +37,7 @@ export default function Resume() { Resume - Freno.dev