18 lines
538 B
JavaScript
18 lines
538 B
JavaScript
/** DisKort
|
|
* (c) Er2 2022
|
|
* Zlib License
|
|
*/
|
|
|
|
// Disable CSP
|
|
function onHeaders(det) {
|
|
for (var i = 0; i < det.responseHeaders.length; i++) {
|
|
if (det.responseHeaders[i].name.toLowerCase() == 'content-security-policy'
|
|
|| det.responseHeaders[i].name.toLowerCase() == 'content-security-policy-report-only'
|
|
) det.responseHeaders[i].value = '';
|
|
}
|
|
return { responseHeaders: det.responseHeaders };
|
|
}
|
|
|
|
chrome.webRequest.onHeadersReceived.addListener(
|
|
onHeaders, {urls: ['<all_urls>']}, ['blocking', 'responseHeaders']
|
|
);
|