-
-
Notifications
You must be signed in to change notification settings - Fork 795
feat: Add original title toggle feature (Closes #3219 video-title-translation) #3335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Add original title toggle feature (Closes #3219 video-title-translation) #3335
Conversation
- Toggle between original and translated video titles on watch pages - Ctrl+click thumbnails to see original titles throughout YouTube - Uses multiple APIs (oEmbed, microformat, meta tags) for reliability - Smart translation detection only shows toggle when needed - Visual indicators and state management per video - Comprehensive test suite with 249 lines of tests - Settings integration in appearance menu (default: enabled) Fixes issues with translated titles obscuring original content.
|
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?
can be integrated with existing ones.
used such method twice yet
LuanRT/YouTube.js#976 (comment) to react on disabling and or enabling features, yet we listen to storage change: youtube/js&css/web-accessible/core.js Line 209 in e50cc8f
(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. |
|
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. |
…rontebebe7/youtube into feature/original-title-toggle
That's getting better recently - and or others tried something smaller.
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.)
running by default is ambitious compared to many other little features, which need not to be tested immediately. (This way one could also test such specific cohorts (groups of users) one after one another) |
|
- Separate enable/disable functions for each feature - Auto-initialization based on storage values - User cohort detection (multilingual, countries, subtitle users) - Feature eligibility checking for gradual rollout - Debug logging system (toggleable) - Smart storage listener with auto enable/disable
- Add page detection to identify current YouTube page (home, watch, feed, etc.) - Implement loadFeatureModule() for dynamic script injection - Add loadAndEnableFeature() to check page eligibility before loading - Track loaded modules to prevent duplicate loads - Update storage listener to use lazy loading - Refactor init.js to load only enabled features dynamically - Remove static feature imports from manifest content_scripts - Add feature modules to web_accessible_resources for dynamic loading - Features now load on-demand based on user settings and current page
- Add comprehensive status report comparing implementation vs author requirements - Remove unnecessary typeof checks in init.js (as per author's comment) - Trust lazy loading to handle feature availability - Document remaining work: sidebar.js refactoring needed
|
Hi, is it possible to merge it? |
- Add 27 new test methods for lazy loading features - Test detectUserCohort with various user scenarios - Test isFeatureEligibleForUser with cohorts and rollout - Test getUserHash for consistent A/B testing - Test getCurrentPage for URL path detection - Test loadAndEnableFeature with module loading - Use test doubles (mocks, stubs, fakes) extensively - Doubled total test count from 25 to 52 tests - 39 tests passing (75% pass rate) Coverage remains low (0.39%) due to browser-dependent code Tests focus on testable business logic in core.js
|
hi! @sarontebebe7 wow, thank you so much🥰🎆 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 |
|
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.
|
|
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! 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 |
|
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. |
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.