diff --git a/src/scripts/ytContent.tsx b/src/scripts/ytContent.tsx index 65c2b5f..aad404f 100644 --- a/src/scripts/ytContent.tsx +++ b/src/scripts/ytContent.tsx @@ -38,31 +38,37 @@ import { getExtensionSettingsAsync, getSourcePlatfromSettingsFromHostname, getTa if (!target || !source) return null const url = getLbryUrlByTarget(target) - return
+ return
findVideoElementAwait(source).then((videoElement) => { videoElement.pause() })} > - + {target.type === 'channel' ? 'Channel on' : 'Watch on'} {target.platform.button.platformNameText}
@@ -72,17 +78,25 @@ import { getExtensionSettingsAsync, getSourcePlatfromSettingsFromHostname, getTa if (!target || !source) return null const url = getLbryUrlByTarget(target) - return
+ return
- + {target.type === 'channel' ? 'Channel on' : 'Watch on'} {target.platform.button.platformNameText}
@@ -110,16 +123,20 @@ import { getExtensionSettingsAsync, getSourcePlatfromSettingsFromHostname, getTa null if (!mountPlayerButtonBefore) render(, playerButtonMountPoint) else { - if (mountPlayerButtonBefore.previousSibling !== playerButtonMountPoint) + if (playerButtonMountPoint.getAttribute('data-id') !== params.source.id) { mountPlayerButtonBefore.parentElement?.insertBefore(playerButtonMountPoint, mountPlayerButtonBefore) + playerButtonMountPoint.setAttribute('data-id', params.source.id) + } render(, playerButtonMountPoint) } const mountButtonBefore = document.querySelector(params.source.platform.htmlQueries.mountPoints.mountButtonBefore[params.source.type]) if (!mountButtonBefore) render(, playerButtonMountPoint) else { - if (mountButtonBefore.previousSibling !== buttonMountPoint) + if (buttonMountPoint.getAttribute('data-id') !== params.source.id) { mountButtonBefore.parentElement?.insertBefore(buttonMountPoint, mountButtonBefore) + buttonMountPoint.setAttribute('data-id', params.source.id) + } render(, buttonMountPoint) } } diff --git a/src/settings/index.ts b/src/settings/index.ts index e71dd40..2ea575a 100644 --- a/src/settings/index.ts +++ b/src/settings/index.ts @@ -84,7 +84,7 @@ export const targetPlatformSettings = { icon: chrome.runtime.getURL('assets/icons/lbry/madiator-logo.svg'), style: { button: { flexDirection: 'row-reverse' }, - icon: { transform: 'scale(1.2)' } + icon: { } } } }), @@ -137,9 +137,9 @@ export const sourcePlatfromSettings = { mountPoints: { mountButtonBefore: { video: 'ytd-video-owner-renderer~#subscribe-button', - channel: '#channel-header-container #buttons' + channel: '#channel-header-container #buttons #subscribe-button' }, - mountPlayerButtonBefore: 'ytd-player .ytp-right-controls', + mountPlayerButtonBefore: 'ytd-watch-flexy ytd-player .ytp-right-controls', }, videoPlayer: '#ytd-player video', videoDescription: 'ytd-video-secondary-info-renderer #description',