Add instantViewUnrollThreads flag

This commit is contained in:
dangered wolf 2024-01-14 16:12:31 -05:00
parent d7965ec941
commit 5dc760638a
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58
7 changed files with 10 additions and 0 deletions

View file

@ -3,6 +3,7 @@ STANDARD_DOMAIN_LIST = "fxtwitter.com,fixupx.com,twittpr.com"
DIRECT_MEDIA_DOMAINS = "d.fxtwitter.com,dl.fxtwitter.com,d.twittpr.com,dl.twittpr.com,d.fixupx.com,d.xfixup.com,dl.fixupx.com,dl.xfixup.com"
TEXT_ONLY_DOMAINS = "t.fxtwitter.com,t.twittpr.com,t.fixupx.com"
INSTANT_VIEW_DOMAINS = "i.fxtwitter.com,i.twittpr.com,i.fixupx.com"
INSTANT_VIEW_THREADS_DOMAINS = "u.fxtwitter.com,u.twittpr.com,u.fixupx.com"
GALLERY_DOMAINS = "g.fxtwitter.com,g.twittpr.com,g.fixupx.com"
MOSAIC_DOMAIN_LIST = "mosaic.fxtwitter.com"
API_HOST_LIST = "api.fxtwitter.com,api-canary.fxtwitter.com"

View file

@ -37,6 +37,7 @@ let envVariables = [
'DIRECT_MEDIA_DOMAINS',
'TEXT_ONLY_DOMAINS',
'INSTANT_VIEW_DOMAINS',
'INSTANT_VIEW_THREADS_DOMAINS',
'GALLERY_DOMAINS',
'HOST_URL',
'REDIRECT_URL',

View file

@ -7,6 +7,7 @@
"BRANDING_NAME": "FxTwitter / FixupX",
"TEXT_ONLY_DOMAINS": "t.fxtwitter.com,t.twittpr.com,t.fixupx.com",
"INSTANT_VIEW_DOMAINS": "i.fxtwitter.com,i.twittpr.com,i.fixupx.com",
"INSTANT_VIEW_THREADS_DOMAINS": "u.fxtwitter.com,u.twittpr.com,u.fixupx.com",
"GALLERY_DOMAINS": "g.fxtwitter.com,g.twittpr.com,g.fixupx.com",
"STANDARD_DOMAIN_LIST": "fxtwitter.com,fixupx.com,twittpr.com",
"DIRECT_MEDIA_DOMAINS": "d.fxtwitter.com,dl.fxtwitter.com,d.fixupx.com,dl.fixupx.com",

View file

@ -5,6 +5,7 @@ export const Constants = {
DIRECT_MEDIA_DOMAINS: DIRECT_MEDIA_DOMAINS.split(','),
TEXT_ONLY_DOMAINS: TEXT_ONLY_DOMAINS.split(','),
INSTANT_VIEW_DOMAINS: INSTANT_VIEW_DOMAINS.split(','),
INSTANT_VIEW_THREADS_DOMAINS: INSTANT_VIEW_THREADS_DOMAINS.split(','),
GALLERY_DOMAINS: GALLERY_DOMAINS.split(','),
MOSAIC_DOMAIN_LIST: MOSAIC_DOMAIN_LIST.split(','),
API_HOST_LIST: API_HOST_LIST.split(','),

View file

@ -55,6 +55,10 @@ export const statusRequest = async (c: Context) => {
} else if (Constants.INSTANT_VIEW_DOMAINS.includes(url.hostname)) {
console.log('Forced instant view request');
flags.forceInstantView = true;
} else if (Constants.INSTANT_VIEW_THREADS_DOMAINS.includes(url.hostname)) {
console.log('Forced unroll instant view');
flags.forceInstantView = true;
flags.instantViewUnrollThreads = true;
} else if (Constants.GALLERY_DOMAINS.includes(url.hostname)) {
console.log('Gallery embed request');
flags.gallery = true;

1
src/types/env.d.ts vendored
View file

@ -3,6 +3,7 @@ declare const STANDARD_DOMAIN_LIST: string;
declare const DIRECT_MEDIA_DOMAINS: string;
declare const TEXT_ONLY_DOMAINS: string;
declare const INSTANT_VIEW_DOMAINS: string;
declare const INSTANT_VIEW_THREADS_DOMAINS: string;
declare const GALLERY_DOMAINS: string;
declare const HOST_URL: string;
declare const EMBED_URL: string;

View file

@ -8,6 +8,7 @@ type InputFlags = {
textOnly?: boolean;
isXDomain?: boolean;
forceInstantView?: boolean;
instantViewUnrollThreads?: boolean;
archive?: boolean;
gallery?: boolean;
};