Skip to content

Conversation

@sarontebebe7
Copy link

  • 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.
Screenshot (205)
Screenshot 2025-11-03 203120
Screenshot 2025-11-03 203044
Screenshot 2025-11-03 203030

- 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.
@sarontebebe7 sarontebebe7 changed the title feat: Add original title toggle feature #3219 video-title-translation feat: Add original title toggle feature (Closes #3219 video-title-translation) Nov 3, 2025
@ImprovedTube
Copy link
Member

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

ImprovedTube.fetchDOMData = function () {

ImprovedTube.fetchDOMData2 = function () {

LuanRT/YouTube.js#976 (comment)


to react on disabling and or enabling features, yet we listen to storage change:

# Immediate reaction to any change of our extension storage (settings)

(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.

@sarontebebe7
Copy link
Author

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...

@ImprovedTube
Copy link
Member

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: #1647 (comment)

(This way one could also test such specific cohorts (groups of users) one after one another)

@ImprovedTube
Copy link
Member

what setup?

also: https://github.com/code-charity/Bulk-Contributor

sarontebebe7 and others added 5 commits November 28, 2025 10:29
- 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
@sarontebebe7 sarontebebe7 reopened this Dec 2, 2025
@sarontebebe7
Copy link
Author

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
@ImprovedTube
Copy link
Member

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.

@sarontebebe7
Copy link
Author

@sarontebebe7
Copy link
Author

I have separated them into 3 PRs..

@ImprovedTube
Copy link
Member

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".

@sarontebebe7
Copy link
Author

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

@sarontebebe7
Copy link
Author

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 😀

@sarontebebe7
Copy link
Author

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

@ImprovedTube
Copy link
Member

ImprovedTube commented Dec 6, 2025

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 )

@ImprovedTube
Copy link
Member

let me know

@sarontebebe7
Copy link
Author

sarontebebe7 commented Dec 8, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants