armcord/utils/csp.js
2021-06-29 17:23:52 +02:00

15 lines
405 B
JavaScript

const { session } = require("electron");
session.defaultSession.webRequest.onHeadersReceived.addListener(
(h) => {
h.responseHeaders.forEach((e, i) => {
if (e.name.toLowerCase() === "content-security-policy") {
e.value = "";
}
});
return { responseHeaders: h.responseHeaders };
},
{ urls: ["*://*.discord.com/*"] },
["blocking", "responseHeaders"]
);
//csp thingz