Skip to content

Commit

Permalink
add support for YT translated titles
Browse files Browse the repository at this point in the history
  • Loading branch information
54ac authored Aug 16, 2024
1 parent 1e84801 commit 7f996eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/titles/pageTitleHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export function setCurrentVideoTitle(title: string) {

if (title === targetTitle) return;

changePageTitleNow(title);
const currentTitle = document.querySelector("#title > h1") as HTMLElement | null;
changePageTitleNow(currentTitle?.innerText || title);
targetTitle = title;
}

Expand Down Expand Up @@ -75,4 +76,4 @@ function setupTitleChangeListener() {
addCleanupListener(() => {
titleChangeObserver?.disconnect?.();
});
}
}

0 comments on commit 7f996eb

Please sign in to comment.