Fix URL detection in YouTube about page

This commit is contained in:
shinigami-eyes 2021-07-05 07:08:13 +00:00
parent 7ad527fa0c
commit 25d5aa6798
1 changed files with 4 additions and 0 deletions

View File

@ -452,6 +452,10 @@ function tryParseURL(urlstr: string) {
function tryUnwrapNestedURL(url: URL): URL {
if (!url) return null;
if (domainIs(url.host, 'youtube.com') && url.pathname == '/redirect') {
const q = url.searchParams.get('q');
if (q && !q.startsWith('http:') && !q.startsWith('https:') && q.includes('.')) return tryParseURL('http://' + q);
}
if (url.href.indexOf('http', 1) != -1) {
if (url.pathname.startsWith('/intl/')) return null; // facebook language switch links