Fix auto video recovery and auto-dubbed audio track handling - #4179
Conversation
Fix YouTube recovery and auto-dub menu
|
hi and thank you!😮@communism420 Functions only beloning to one specific feature can be nested in the feature to be defined conditionally only. Unless you predict them being useful for other features too.
this is rare, stopAutoDubbingGuard() can run called by our storage listener, when the toggle is switched off while on youtube, if ever
we can keep this. |
|
@ImprovedTube2 Hi, thank you for the review! I’ve addressed the points you mentioned:
I also added regression tests for conditional initialization and complete guard cleanup. All 99 tests and the GitHub Actions check pass. Please let me know if this matches the intended structure. Thank you! |
|
@ImprovedTube2 |
|
Added both This makes temporary loading in Firefox much more convenient for testing (otherwise it fails with the classic "background.service_worker is currently disabled" error). Chrome ignores the Also, it might slightly increase the chances that this PR will be noticed and approved |
|
I’ve fixed another edge case in the filtered auto-dubbing audio menu. When navigating back from the Audio track submenu, YouTube could detach the outgoing panel and measure the main settings menu while the compact audio-menu constraints were still active. As a result, the main menu remained incorrectly reduced in both Brave and Firefox. The update:
The compact filtered audio menu continues to work as before, while the main settings menu now immediately returns to its native size. Validation: all 22 test suites and 100 tests pass, along with ESLint and syntax checks. |
|
I’ve fixed a remaining timing race when returning from the filtered Audio track submenu to the main settings menu. The previous restoration could still preserve an intermediate compact height written during YouTube’s transition. This caused the main settings menu to remain slightly shorter than its native size. The follow-up update:
Validation: all 22 test suites and 101 tests pass, along with ESLint, JavaScript syntax, and diff checks. |
|
hi, thank you! @communism420, so sorry for the delay! |
|
@ImprovedTube2 Hi, thank you for the clarification, and no worries about the delay. I’m sorry for the delay on my side as well. I’ve updated both affected startup paths according to your guidance:
Therefore, when either feature is disabled during initialization, its entry point is not called and performs no work. Cleanup remains only for an actual I also audited the PR for the same pattern and found no other new unconditional startup calls for these features. Regression tests were added to prevent this behavior from returning. Validation: all 23 test suites and 109 tests pass, along with ESLint, JavaScript syntax, and diff checks. Thank you for pointing this out! |
|
Thank you! @communism420 Did you test in the browser?
little yet! looking forward |
Hi! |
|
nice! |
(Sorry we're not yet filtering LLM stuff so it multiplies the flood of characters (scroll height) and am getting used to the majority being untested. Thus (by now) looking forward short messages (human indicator) and color coded PR code to distinguish various (non-)(human) authors.) |
Summary
This PR fixes two player-related issues:
Auto video recovery
<video>element and cleans up listeners/timers when disabled or when the player changes.video.load(), avoiding unnecessary stream resets and slow video startup.play()rejections as extension errors.Auto dubbing and audio tracks
First-open audio menu layout
Tests