I'm going to start out by saying this has been submitted as a PR for Flarum core but in case it gets rejected or not implemented for some time I have created an extension to accomplish it.
๐ Seamless Refresh โ kill the "reload this page" nag without ever going stale
You know the one. You're halfway through a long post โ reading or typing โ and Flarum pops up: "A new version of this page is available. [Reload]". On a busy forum where assets rebuild often (deploys, extension toggles), that alert can feel like it's constantly nagging you.
Seamless Refresh takes a gentler approach: when newer assets are detected, it doesn't interrupt you at all โ it just quietly remembers. The next time you actually navigate โ click a link, open a discussion, use back/forward โ the browser does a normal full page load of that destination, so the fresh assets come along for the ride.
No modal, no timing guesswork, no risk of wiping a draft. You're never interrupted, and your very next click is already on the new assets.
โจ What you get
- ๐คซ Never interrupts a reading or typing user โ nothing appears mid-session.
- โก Always up to date โ the very next navigation boots on the new assets.
- ๐ง Zero configuration โ enable it and you're done. No settings at all.
- ๐ชถ No backend โ it only changes how the frontend reacts to the
X-Flarum-Assets-Revision header Flarum already sends with every API response.
๐ง How it works
Flarum core detects a new asset revision in ForumApplication.checkAssetsRevision and shows the alert. This extension overrides that method to set a flag instead, and registers a capture-phase click listener: while the flag is set, an internal same-origin link click becomes a full page load (window.location.assign), so the destination boots with the new assets. Back/forward navigation reloads too.
It deliberately does not touch:
- Modified clicks (Ctrl/โ/Shift/middle โ "open in new tab")
target="_blank" and download links
- In-page anchors (
#โฆ), javascript:, mailto:, and tel: links
- External links
And it never fires while you're just reading or typing โ only a real navigation triggers the refresh, so the browser's own "unsaved changes" guard still protects an open composer.
๐ Credit
The behaviour is a direct implementation of the "refresh on the next natural interaction" idea luceos proposed on the Flarum tracker as a middle ground between always interrupt and never warn. If you like it, it's also being proposed for Flarum core.
๐ฆ Installation
composer require ernestdefoe/seamless-refresh
Then enable Seamless Refresh in Admin โ Extensions. That's it โ no settings.
๐ Updating
composer update ernestdefoe/seamless-refresh
php flarum cache:clear
๐ GitHub: ernestdefoe/seamless-refresh
๐ฆ Packagist: https://packagist.org/packages/ernestdefoe/seamless-refresh
๐ฌ Support forum: https://ernestdefoe.online
๐ License: MIT
Questions, bugs, or edge cases I missed? Open an issue on GitHub or stop by the support forum.