Skip to content

Commit

Permalink
Merge pull request #24 from BlackLanzer/main
Browse files Browse the repository at this point in the history
Translate title attribute
  • Loading branch information
zpix1 authored Jan 7, 2024
2 parents faabdee + a0d6e2a commit 1ba4594
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"update_url": "https://clients2.google.com/service/update2/crx",
"name": "YouTube Anti Translate",
"version": "1.5.12",
"version": "1.5.13",
"description": "A small extension to disable YT video titles autotranslation.",
"manifest_version": 2,
"content_scripts": [{
Expand Down
2 changes: 1 addition & 1 deletion app/pages/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</style>

<body>
<div class="header">YT Anti Translate 1.5.12</div>
<div class="header">YT Anti Translate 1.5.13</div>

Status:
<div class="status enabled" id="status">Enabled</div>
Expand Down
4 changes: 4 additions & 0 deletions app/src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ function untranslateOtherVideos() {
console.log(`[YoutubeAntiTranslate] translated from "${titleElement.innerText}" to "${title}"`);
if (titleElement) {
video.querySelector('#video-title:not(.cbCustomTitle)').innerText = title;
video.querySelector('#video-title:not(.cbCustomTitle)').title = title;
if (video.querySelector('a#video-title-link:not(.cbCustomTitle)')) { // home page
video.querySelector('a#video-title-link:not(.cbCustomTitle)').title = title;
}
}
}
});
Expand Down

0 comments on commit 1ba4594

Please sign in to comment.