You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Press "Go back one page" in your browser (left arrow, I am using the firefox term).
The app is frozen.
Workaround
I am making my links open in a new tab but the workaround is not desirable since I have to implement a specialized Hyperlink struct for egui which is a lot of boilerplate for a link :(.
When going back, the browser is not actually reloading the previous page but reuse directly an in memory cache of the page with "frozen" javascript callback / promises.
This is not supported by Bevy, I'll try to look into what can be done (short task list: check js events are forwarded by winit, and try to react to them in Bevy, maybe like for Android suspend / resume. help is welcome!).
In the meantime, you can set js event listeners on your page destroying the canvas and recreating it when the page is reloaded from the bfcache, it should restart Bevy
This was addressed by Winit in rust-windowing/winit#2851 and rust-windowing/winit#2912 and should just work for Bevy after #8745. Correct handling of the Suspended/Resumed events required of course.
Let me know if there are any remaining issues though.
Activity
mockersf commentedon Oct 31, 2023
This is due to a browser feature called "bfcache": https://web.dev/articles/bfcache
When going back, the browser is not actually reloading the previous page but reuse directly an in memory cache of the page with "frozen" javascript callback / promises.
This is not supported by Bevy, I'll try to look into what can be done (short task list: check js events are forwarded by winit, and try to react to them in Bevy, maybe like for Android suspend / resume. help is welcome!).
In the meantime, you can set js event listeners on your page destroying the canvas and recreating it when the page is reloaded from the bfcache, it should restart Bevy
carrascomj commentedon Oct 31, 2023
Thanks for the useful pointers and the link! I'll study the event listeners route.
fix: always open links in a new tab
daxpedda commentedon Nov 1, 2023
This was addressed by Winit in rust-windowing/winit#2851 and rust-windowing/winit#2912 and should just work for Bevy after #8745. Correct handling of the
Suspended/Resumedevents required of course.Let me know if there are any remaining issues though.