You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
[HTML5] PWA service worker prefers cached version.
Use an offline first approach, where we prefer the cached version over the network one. This forces games using PWA to always re-export the project and not just the PCK, so that the service worker version gets updated correctly, and the end-user cache is correctly cleared on update.
This commit is contained in:
@@ -189,6 +189,9 @@ const Engine = (function () {
|
||||
preloader.preloadedFiles.length = 0; // Clear memory
|
||||
me.rtenv['callMain'](me.config.args);
|
||||
initPromise = null;
|
||||
if (me.config.serviceWorker && 'serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register(me.config.serviceWorker);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user