[Enhancement]: If Web Player is currently playing a book, exiting page should bring up prompt to confirm page exit and update player position #2641

Open
opened 2026-04-25 00:09:12 +02:00 by adam · 4 comments
Owner

Originally created by @ZLoth on GitHub (Mar 8, 2025).

Type of Enhancement

None

Describe the Feature/Enhancement

When you are leaving the ABS page while an audiobook is playing, you are prompted if you really want to leave the page. This is to preserve progress and prevent accidental clicks. This may be accomplished with the Javascript function window.onbeforeunload .

Why would this be helpful?

As currently coded, if you have the web player playing a book and you exit the web page, the page exits immediately and your position is lost. By providing a prompt, this allows you to confirm before accidentally exiting the page and losing your progress.

Future Implementation (Screenshot)

Not applicable.

Audiobookshelf Server Version

2.19.5

Current Implementation (Screenshot)

https://github.com/user-attachments/assets/c4972077-4e56-411c-8f0f-f17c8761de41

Originally created by @ZLoth on GitHub (Mar 8, 2025). ### Type of Enhancement None ### Describe the Feature/Enhancement When you are leaving the ABS page while an audiobook is playing, you are prompted if you really want to leave the page. This is to preserve progress and prevent accidental clicks. This may be accomplished with the Javascript function window.onbeforeunload . ### Why would this be helpful? As currently coded, if you have the web player playing a book and you exit the web page, the page exits immediately and your position is lost. By providing a prompt, this allows you to confirm before accidentally exiting the page and losing your progress. ### Future Implementation (Screenshot) Not applicable. ### Audiobookshelf Server Version 2.19.5 ### Current Implementation (Screenshot) https://github.com/user-attachments/assets/c4972077-4e56-411c-8f0f-f17c8761de41
adam added the enhancement label 2026-04-25 00:09:12 +02:00
Author
Owner

@nichwall commented on GitHub (Mar 8, 2025):

Progress is synced automatically every 30 seconds while playing media, so you wouldn't lose much progress if you accidentally navigate away or close the tab. Are you encountering progress not syncing with the web client?

@nichwall commented on GitHub (Mar 8, 2025): Progress is synced automatically every 30 seconds while playing media, so you wouldn't lose much progress if you accidentally navigate away or close the tab. Are you encountering progress not syncing with the web client?
Author
Owner

@ZLoth commented on GitHub (Mar 8, 2025):

Oh, so that explains it. When I played 40 seconds into the chapter then left the page, I was still able to get back to the position. I was testing with only about 10 seconds played.

I still think it would be nice to have a warning come up if the player is playing media.

@ZLoth commented on GitHub (Mar 8, 2025): Oh, so that explains it. When I played 40 seconds into the chapter then left the page, I was still able to get back to the position. I was testing with only about 10 seconds played. I still think it would be nice to have a warning come up if the player is playing media.
Author
Owner

@june012006 commented on GitHub (Apr 28, 2025):

Progress is synced automatically every 30 seconds while playing media, so you wouldn't lose much progress if you accidentally navigate away or close the tab. Are you encountering progress not syncing with the web client?

It isn't sync'd though. Just spent an hour listening to a book, on 2.19.2 while on my computer. Then, I switched to my phone, and it started at the point before, and the webui had no record of listening on the web

@june012006 commented on GitHub (Apr 28, 2025): > Progress is synced automatically every 30 seconds while playing media, so you wouldn't lose much progress if you accidentally navigate away or close the tab. Are you encountering progress not syncing with the web client? It isn't sync'd though. Just spent an hour listening to a book, on 2.19.2 while on my computer. Then, I switched to my phone, and it started at the point before, and the webui had no record of listening on the web
Author
Owner

@nichwall commented on GitHub (Apr 28, 2025):

Progress is synced automatically every 30 seconds while playing media, so you wouldn't lose much progress if you accidentally navigate away or close the tab. Are you encountering progress not syncing with the web client?

It isn't sync'd though. Just spent an hour listening to a book, on 2.19.2 while on my computer. Then, I switched to my phone, and it started at the point before, and the webui had no record of listening on the web

There are still sync issues when switching between devices, particularly when opening the app from the background instead of fully closing the app when not using it.

@nichwall commented on GitHub (Apr 28, 2025): > > Progress is synced automatically every 30 seconds while playing media, so you wouldn't lose much progress if you accidentally navigate away or close the tab. Are you encountering progress not syncing with the web client? > > It isn't sync'd though. Just spent an hour listening to a book, on 2.19.2 while on my computer. Then, I switched to my phone, and it started at the point before, and the webui had no record of listening on the web There are still sync issues when switching between devices, particularly when opening the app from the background instead of fully closing the app when not using it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2641