armcord/utils/plugins/goosemod/CSP.js

22 lines
719 B
JavaScript
Raw Normal View History

2021-03-20 19:02:37 +00:00
chrome.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']
)
2021-05-22 21:21:07 +00:00
const corsAllowUrls = [
'https://github.com/GooseMod/GooseMod/releases/download/dev/index.js',
'https://github-releases.githubusercontent.com/'
];
if (corsAllowUrls.some((x) => url.startsWith(x))) {
responseHeaders['access-control-allow-origin'] = ['*'];
}
//psst stolen from https://raw.githubusercontent.com/Goose-Nest/GooseUpdate/main/branches/goosemod/patch.js
//dont tell anyone :troll: