YouTube usernames and vanity names can be different
This commit is contained in:
parent
6b474eaf8a
commit
7ad527fa0c
@ -513,9 +513,10 @@ function getIdentifierFromURLImpl(url: URL): string {
|
||||
} else if (domainIs(host, 'twitter.com')) {
|
||||
return 'twitter.com' + getPartialPath(url.pathname, 1);
|
||||
} else if (domainIs(host, 'youtube.com')) {
|
||||
const pathname = url.pathname.replace('/c/', '/user/');
|
||||
if (!pathname.startsWith('/user/') && !pathname.startsWith('/channel/')) return null;
|
||||
return 'youtube.com' + getPartialPath(pathname, 2);
|
||||
const pathname = url.pathname;
|
||||
if (pathname.startsWith('/user/') || pathname.startsWith('/c/') || pathname.startsWith('/channel/'))
|
||||
return 'youtube.com' + getPartialPath(pathname, 2);
|
||||
return 'youtube.com' + getPartialPath(pathname, 1);
|
||||
} else if (domainIs(host, 'disqus.com') && url.pathname.startsWith('/by/')) {
|
||||
return 'disqus.com' + getPartialPath(url.pathname, 2);
|
||||
} else if (domainIs(host, 'medium.com')) {
|
||||
|
Loading…
Reference in New Issue
Block a user