cors my beloved <3

This commit is contained in:
smartfridge 2021-05-22 23:21:07 +02:00 committed by GitHub
parent 70e8a95a50
commit e4b54dda05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -8,3 +8,14 @@ chrome.webRequest.onHeadersReceived.addListener((h) => {
}, {urls: ["*://*.discord.com/*"]},
['blocking', 'responseHeaders']
)
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: