Disable redirection when a link in the YouTube description section is entered

This commit is contained in:
Hamza 2024-02-22 15:56:35 +03:00 committed by GitHub
parent 4fc8c6cdcd
commit a7665994f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -496,6 +496,9 @@ function redirect(url, type, initiator, forceRedirection, incognito) {
const watch = url.pathname.substring(url.pathname.lastIndexOf('/') + 1) const watch = url.pathname.substring(url.pathname.lastIndexOf('/') + 1)
return `${randomInstance}/watch?v=${watch}` return `${randomInstance}/watch?v=${watch}`
} }
if (url.hostname.endsWith("youtube.com") && url.pathname.startsWith("/redirect?")) {
return url.href
}
return `${randomInstance}${url.pathname}${url.search}` return `${randomInstance}${url.pathname}${url.search}`
} }
case "invidiousMusic": { case "invidiousMusic": {