aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/render/CategoryPill.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/CategoryPill.tsx')
-rw-r--r--src/render/CategoryPill.tsx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/render/CategoryPill.tsx b/src/render/CategoryPill.tsx
index 57730af9..20923fba 100644
--- a/src/render/CategoryPill.tsx
+++ b/src/render/CategoryPill.tsx
@@ -43,9 +43,15 @@ export class CategoryPill {
}
private async attachToPageInternal(): Promise<void> {
- const referenceNode =
+ let referenceNode =
await waitFor(() => getYouTubeTitleNode());
+ // Experimental YouTube layout with description on right
+ const isOnDescriptionOnRightLayout = document.querySelector("#title #description");
+ if (isOnDescriptionOnRightLayout) {
+ referenceNode = referenceNode.parentElement;
+ }
+
if (referenceNode && !referenceNode.contains(this.container)) {
if (!this.container) {
this.container = document.createElement('span');
@@ -91,7 +97,9 @@ export class CategoryPill {
parent.appendChild(this.container);
referenceNode.prepend(parent);
- referenceNode.style.display = "flex";
+ if (!isOnDescriptionOnRightLayout) {
+ referenceNode.style.display = "flex";
+ }
}
}