mirror of
https://github.com/LBRYFoundation/Watch-on-LBRY.git
synced 2025-08-23 17:47:26 +00:00
🍣 little bug fix
This commit is contained in:
parent
1eb21eb51f
commit
ce11d4fdf3
1 changed files with 59 additions and 55 deletions
|
@ -159,6 +159,7 @@ import { getExtensionSettingsAsync, getSourcePlatfromSettingsFromHostname, getTa
|
||||||
const url = new URL(location.href);
|
const url = new URL(location.href);
|
||||||
let target = (await getTargetsByURL(url))[url.href]
|
let target = (await getTargetsByURL(url))[url.href]
|
||||||
|
|
||||||
|
try {
|
||||||
if (settings.redirect) {
|
if (settings.redirect) {
|
||||||
if (!target) continue
|
if (!target) continue
|
||||||
if (url === urlCache) continue
|
if (url === urlCache) continue
|
||||||
|
@ -189,6 +190,7 @@ import { getExtensionSettingsAsync, getSourcePlatfromSettingsFromHostname, getTa
|
||||||
const anchors = Array.from(descriptionElement.querySelectorAll<HTMLAnchorElement>('a'))
|
const anchors = Array.from(descriptionElement.querySelectorAll<HTMLAnchorElement>('a'))
|
||||||
|
|
||||||
for (const anchor of anchors) {
|
for (const anchor of anchors) {
|
||||||
|
if (!anchor.href) continue
|
||||||
const url = new URL(anchor.href)
|
const url = new URL(anchor.href)
|
||||||
let lbryURL: URL | null = null
|
let lbryURL: URL | null = null
|
||||||
if (sourcePlatform === sourcePlatfromSettings['youtube.com']) {
|
if (sourcePlatform === sourcePlatfromSettings['youtube.com']) {
|
||||||
|
@ -221,7 +223,9 @@ import { getExtensionSettingsAsync, getSourcePlatfromSettingsFromHostname, getTa
|
||||||
// We run it anyway with null target to hide the button
|
// We run it anyway with null target to hide the button
|
||||||
updateButton(target)
|
updateButton(target)
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
urlCache = url
|
urlCache = url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue