This commit is contained in:
Aria Stewart 2022-03-20 17:03:59 -04:00 committed by GitHub
commit fadb02002f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -513,7 +513,14 @@ function getIdentifierFromURLImpl(url: URL): string {
if (pathname.includes('/comments/') && hostname == 'reddit.com') return null;
return 'reddit.com' + getPartialPath(pathname, 2);
} else if (domainIs(host, 'twitter.com')) {
return 'twitter.com' + getPartialPath(url.pathname, 1);
const isSpecial = url.pathname.startsWith('/i/');
const isCommunity = url.pathname.startsWith('/i/communities/');
if (isCommunity) {
return 'twitter.com' + getPartialPath(url.pathname, 3);
} else if (!isSpecial) {
return 'twitter.com' + getPartialPath(url.pathname, 1);
}
return null;
} else if (domainIs(host, 'youtube.com')) {
const pathname = url.pathname;
if (pathname.startsWith('/user/') || pathname.startsWith('/c/') || pathname.startsWith('/channel/'))