aboutsummaryrefslogtreecommitdiffstats
path: root/src/assets/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/assets/javascripts')
-rw-r--r--src/assets/javascripts/helpers/twitter.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/assets/javascripts/helpers/twitter.js b/src/assets/javascripts/helpers/twitter.js
index 3ad01b7f..bacbdcfc 100644
--- a/src/assets/javascripts/helpers/twitter.js
+++ b/src/assets/javascripts/helpers/twitter.js
@@ -184,6 +184,20 @@ function switchInstance(url) {
return `${randomInstance}${url.pathname}${url.search}`;
}
+function removeXFrameOptions(e) {
+ let url = new URL(e.url);
+ let protocolHost = `${url.protocol}//${url.host}`;
+ let twitterList = [
+ ...redirects.nitter.normal,
+ ...redirects.nitter.tor,
+ ...nitterNormalCustomRedirects,
+ ...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 };
+}
+
function isNitter(url, type) {
let protocolHost = `${url.protocol}//${url.host}`;
@@ -299,6 +313,8 @@ export default {
getBypassWatchOnTwitter,
setBypassWatchOnTwitter,
+ removeXFrameOptions,
+
getProtocol,
setProtocol,