[Bug]: Goback (previous page) button does not work and has to be pressed multiple times after using new plugin "Unobstrusive player"
Preflight Checklist
- [x] I use the latest version of YouTube Music (Application).
- [x] I have searched the issue tracker for a bug report that matches the one I want to file, without success.
- [x] I understand that th-ch/youtube-music has NO affiliation with Google or YouTube
YouTube Music (Application) Version
3.8.0.0
Checklists
- [ ] I use the portable version of the YouTube Music Application.
- [ ] I can reproduce this issue in the official version of (WEB) YTM.
What operating system are you using?
Windows
Operating System Version
22H2 iot enterprise
What CPU architecture are you using?
x64
Last Known Working YouTube Music (Application) version
No response
Reproduction steps
enable Unobstrusive player then search a song. play 3-4 songs from any path i played from videos path. Play couple of songs then press goback button.
Expected Behavior
goback button must pushed me to the previous page in my case to searched page from songs and videos page
Actual Behavior
it has to pressed multiple times after playing some songs. Sometimes it doesn't even work
Enabled plugins
Unobstrusive Player
Additional Information
i always use your app to listen to music. Love your work just reported what i think must not be there. If fixable then please get it fixed.
YouTube Music's behavior when opening and closing the player leads to a new URL (adding to the history stack). How this plugin works is it hides and closes the player once a song is clicked (leading to a new URL on close). If you go back to a "previous page", it can be the player page — in the open state, but hidden. Since it is hidden, it will look like nothing's changing when going back.
If you prioritize going back and forth through the pages over not having the player popping up, you can disable the plugin for now.
I have yet to come up with a workaround with this. If someone can, it would be highly appreciated!
I'd imagine we can monkeypatch the history API to prevent useless history like that?
Unless it uses an internal router
I'd imagine we can monkeypatch the history API to prevent useless history like that?
Unless it uses an internal router
That was my initial thought, but the player still pops up even when intercepting.
I've also tried a manual history.back() approach on play but it has an unintended side effect of re-rendering the page when traversing the history from player to any regular page. It doesn't do shallow routing like react does.
Hey @TheKidBaby,
Thanks for reporting this! It looks like the issue is related to how the "Unobtrusive Player" plugin interacts with YouTube Music's navigation history. Since the player closing adds new entries to the history stack, pressing the back button might take you through these hidden player states before actually going back to the previous page.
Here are a few things you can try:
Manually navigate back – Instead of using the back button, try clicking directly on the "Search" or "Library" tabs to see if it helps.
Disable the plugin temporarily – If smooth navigation is a priority, disabling the plugin should restore normal behavior.
Wait for a fix – As @franz-dc mentioned, there might be a way to monkeypatch the history API to prevent unnecessary entries, but it's still being investigated.
If you have any specific scenarios where the issue happens more frequently, sharing those might help the devs find a workaround faster.
Hello ChatGPT @yashhhYB
Should fix the typo Unobstrusive in the issue title to prevent additional duplicates