Allow Client to Handle Reload
See original GitHub issueThe current client implementation handles reloading by calling window.reload
.
This doesn’t make sense for WebExtensions where reloading is done by calling runtime.reload
. I’m sure there are other contexts where you’d want to customize the reload behavior also (electron?).
It would be great if there was an API to customize the implementation of this function.
Maybe something along the lines of
import.meta.hot.registerReloadHandler(() => {
// do your reloading here
browser.runtime.reload()
});
The default registered reload handler could be the location one to preserve existing behavior.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Trigger client-side reload in next.js - Stack Overflow
What we need is a client-side reload. The "getInitialProps" function should be called in the browser. So, how to do the client-side reload?...
Read more >Allow User Reload - QlikView App Dev - Qlik Community
Hi All, How can a user be given the privilege to Reload the QVW report or QVW application i tried to use by,...
Read more >Single Page Refresh for Client Side Data Server Side
You might be tempted to just test if the cookie is set, and if not, set it and reload. PHP and jQuery here...
Read more >location.reload() - Web APIs | MDN
The reload may be blocked and a SECURITY_ERROR DOMException thrown. This happens if the origin of the script calling location.reload() ...
Read more >Using the refresh token - Amazon Cognito - AWS Documentation
See the setRefreshThreshold() method of CognitoIdentityProviderClientConfig in the Amplify Android SDK reference. Your user's account itself never expires, as ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, I also wonder if this line is returning false in your electron environment:
const isWindowDefined = typeof window !== 'undefined';
Which would then cause our normal reload function to do nothing instead of reloading:
Thank you for the kind words!