š ImproveTube fails to initialize UI buttons due to race condition with YouTubeās playback speed button
Title: Description: ImproveTubeās videoPageUpdate function (called during init) attempts to access YouTubeās native playback speed button (playerPlaybackSpeedButton) before it exists in the DOM. This causes the following error:
Uncaught TypeError: can't access property "addEventListener", button is undefined
playerPlaybackSpeedButton moz-extension://.../player.js:1118
As a result, ImproveTubeās extra buttons (e.g., repeat, screenshot, rotate) do not appear until the page is manually refreshed.
Steps to Reproduce:
- Navigate to any YouTube page (e.g., /feed/subscriptions or a video watch page).
- Observe that ImproveTubeās extra buttons are missing.
- Open the browser console and see the error above.
- Manually refresh the page ā buttons appear as expected.
Expected Behaviour: ImproveTubeās buttons should load automatically without requiring a manual refresh.
Actual Behaviour: Buttons only appear after refreshing the page, and the console shows the race condition error.
Additional Info: Error stack trace points to videoPageUpdate ā init in ImproveTubeās player.js and functions.js. The issue is caused by ImproveTube assuming YouTubeās UI is ready, but it is loaded dynamically after ImproveTubeās scripts run. A proper fix would involve using MutationObserver or waiting for YouTubeās UI elements to exist before initializing ImproveTubeās buttons.
Hie @TheManInTheWall doesn't seem like this one is taken can it be assigned to me.
This issue was probably fixed by #4018. Could you check whether you're using a version that includes that change?
This issue was probably fixed by #4018. Could you check whether you're using a version that includes that change?
Seems fixed. Thanks