feat: Add original title toggle feature (Closes #3219 video-title-translation)
- Toggle between original and translated video titles on watch pages
- Ctrl+click thumbnails to see original titles throughout YouTube
- Smart translation detection only shows toggle when needed
- Visual indicators and state management per video
- Settings integration in appearance menu (default: enabled)
Fixes issues with translated titles obscuring original content.
If Youtube tends to change the title of a video you can click on the title to see the original one and if you are on a home page, or a history page, search page or for the side-bar translated video titles, Ctrl+click should be able to show you the original one.
wow 🥰 thank you so much! so much work! how many 100 hours did you take and do you use an LLM considering the whole repo?
window.addEventListener('message'
can be integrated with existing ones.
background.js
used such method twice yet https://github.com/code-charity/youtube/blob/c301a5d6ef1e18059d00b49cf079d7eef5302ba4/js%26css/web-accessible/www.youtube.com/player.js#L210 https://github.com/code-charity/youtube/blob/c301a5d6ef1e18059d00b49cf079d7eef5302ba4/js%26css/web-accessible/www.youtube.com/player.js#L1864
https://github.com/LuanRT/YouTube.js/issues/976#issuecomment-2981555518
to react on disabling and or enabling features, yet we listen to storage change: https://github.com/code-charity/youtube/blob/e50cc8f0ed2419f64ce6911ebed741a674dc73c1/js%26css/web-accessible/core.js#L209 (optional, since most our features are permanent settings and many users know that some extension features might only run at page load)
--
Checking if your function is defined shouldn't be required, did it load late? We can become like a user-script manager. and depend on the settings, if a user uses a function only then it needs to be loaded; https://github.com/raingart/Nova-YouTube-extension.
Yes, I have used LLM to understand the code base structure and certain areas. for the fetchDom yes it can be integrated with the exisiting one. I will improve it like that. As for the 3rd one , the current function is by default-on because users immediately encounters videos on their home page already translated so if they have to go and turn the setting on they are going to have to refresh the page which is not ideal because the videos might not be still there...
LLM to understand the code base
That's getting better recently - and or others tried something smaller.
what setup? Will make a great addition to our developer introduction, and i would like to add priority / config to help it prioritize. We are prepared with labels like "knowledge base".
3rd
Most of our features' functions can be modular to be repurposable. We can separate and automate any if (storageValue === ... } : 1. At page load, while loading settings, we can call enabled functions. (Manual order yet, but could mostly become a short loop, when using the same name for toggles and functions.)
2. Equally, at storage-change (rarely), we also react to users toggling in the menu at core.js through just calling that function (if true). Or undoing anything, if necessary, that's where your if (storageValue === false block can move to.
the current function is by default-on
running by default is ambitious compared to many other little features, which need not to be tested immediately. and there will be a lot of feedback. Then we can start optimizing, commenting the console.log's etc. - And optimally (in between), we decide by describing how many percent of users are likely to appreciate the feature and who will like/miss it the the most? Those who have set a secondary language in the browser or two? - Countries with multiple first languages? User who are logged in to Youtube and or use anything beyond /watch URLs? @Humbug007 related subtitle language priorty: https://github.com/code-charity/youtube/issues/1647#issuecomment-1498080775
(This way one could also test such specific cohorts (groups of users) one after one another)
what setup?
also: https://github.com/code-charity/Bulk-Contributor
Hi, is it possible to merge it?
hi! @sarontebebe7 wow, thank you so much🥰🎆
tested?
sorry to be late
can the PR be split this into separate PRs to merge the feature first before the auto testing and the conditional loading of features? Would be nice to merge it already of course; including the multilingual cohort, if without a doubt.
https://github.com/code-charity/youtube/pull/3432----conditional loading https://github.com/code-charity/youtube/pull/3431---core feature https://github.com/code-charity/youtube/pull/3433--testing
I have separated them into 3 PRs..
hi! @sarontebebe7 Thank you again! 🥰 tested? So all is 3874 lines, and separately they are 2421 + 2875 + 3874? Should we publish a previous version?
Would publish the feature today with other updates, if it was possible to review reading < 1000 lines.
(Else we can still release it next week)
LLM
what setup? Will make a great addition to our developer introduction, and i would like to add priority / config to help it prioritize. We are prepared with labels like "knowledge base".
I believe we can merge only the #2421 now, because it has the main core feature. that you previously approved of. The other two can be done later because it is testing feature and the lazy loading....if that's okay with you
the two PRs are stacked because they include the previous changes of the core feature and I couldn't separate it out. So, I would appreciate if you do so 😀
hi! @sarontebebe7 Thank you again! 🥰 tested? So all is 3874 lines, and separately they are 2421 + 2875 + 3874? Should we publish a previous version? the previous version is also okay to publish
hi! Happy about manual work. Often it becomes hard to find among many generated lines. Which part did you write or test?
( We increasingly see new Github accounts with pro-badge submitting generated content.
Then i can't know how many percent of lines humans wrote and how many are useful.
If LLMs will write part of this (and other) projects, then with original authors' knowledge and patience could set it up better / prioritize it first of course. Thanks )
let me know
Hiii, so as far as the first published which was the original-title.js I wrote most of them with the help of LLM ofcourse. As for the lazy loading however it is full AI but I have tested it manually and it has passed.I used full AI for that because it was suggested later and I wanted to know how it basically worked. I focused more on the core feature(original-title.js) the first one I published.