Browse Source

Better warnings for firefox CSP

pull/54/head
coomdev 2 years ago
parent
commit
1826789321
  1. 11
      src/main.ts

11
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');

Loading…
Cancel
Save