diff --git a/src/main.ts b/src/main.ts index 6c17b6f..c6a2e9f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -659,6 +659,17 @@ const startup = async (is4chanX = true) => { if (init) return; init = true; + + window.addEventListener("securitypolicyviolation", (e) => { + if (e.blockedURI.startsWith("blob")) { + if (supportedMainDomain(location.host)) { + fireNotification("error", "CSP is preventing PEE from running, add blob: to the allowed JS whitelist in 4chanX in Advanced Settings"); + } else if (supportedAltDomain(location.host)) { + fireNotification("error", "CSP is preventing PEE from running, use a CSP bypass extension like PEE-companion"); + } + } + }); + const meta = document.querySelector('meta[name="referrer"]') as HTMLMetaElement; const customStyles = document.createElement('style');