processing url: alt domains for services and fixvx support

This commit is contained in:
wukko 2023-12-25 18:04:52 +06:00 committed by dumbmoron
parent 5928b21fee
commit aaa61cfee9
No known key found for this signature in database
GPG key ID: C59997C76C6A8E5F
2 changed files with 3 additions and 1 deletions

View file

@ -13,6 +13,7 @@
}, },
"twitter": { "twitter": {
"alias": "twitter videos & voice", "alias": "twitter videos & voice",
"altDomains": ["x.com", "vxtwitter.com", "fixvx.com"],
"patterns": [":user/status/:id", ":user/status/:id/video/:v"], "patterns": [":user/status/:id", ":user/status/:id/video/:v"],
"enabled": true "enabled": true
}, },

View file

@ -27,8 +27,9 @@ export function aliasURL(url) {
break; break;
case "vxtwitter": case "vxtwitter":
case "fixvx":
case "x": case "x":
if (['x.com', 'vxtwitter.com'].includes(url.hostname)) { if (services.twitter.altDomains.includes(url.hostname)) {
url.hostname = 'twitter.com' url.hostname = 'twitter.com'
} }
break; break;