Fixed bug with responseHeaders #135

This commit is contained in:
ManeraKai 2022-03-24 06:17:12 +03:00
parent 3e44649133
commit 94c6450401
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337

View File

@ -194,8 +194,12 @@ function removeXFrameOptions(e) {
...nitterTorCustomRedirects,
];
if (!twitterList.includes(protocolHost) && e.type != 'sub_frame') return;
for (const i in e.responseHeaders) if (e.responseHeaders[i].name = 'x-frame-options') e.responseHeaders.splice(i, 1);
return { responseHeaders: e.responseHeaders };
let isChanged = false;
for (const i in e.responseHeaders) if (e.responseHeaders[i].name = 'x-frame-options') {
isChanged = true;
e.responseHeaders.splice(i, 1);
}
if (isChanged) return { responseHeaders: e.responseHeaders };
}
function isNitter(url, type) {