Full document, spreadsheet, slideshow, and diagram tooling
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'feat: register Service Worker in all editors for guaranteed offline support' (#367) from feat/sw-registration into main

scott a307cd92 bec91806

+50 -1
+2 -1
public/sw.js
··· 8 8 * - API/WS/health: network-only (never cached) 9 9 */ 10 10 11 - const CACHE_NAME = 'tools-v6'; 11 + const CACHE_NAME = 'tools-v7'; 12 12 13 13 // Static assets to pre-cache on install 14 14 const PRECACHE_URLS = [ ··· 19 19 '/diagrams/index.html', 20 20 '/slides/index.html', 21 21 '/forms/index.html', 22 + '/calendar/index.html', 22 23 ]; 23 24 24 25 // Extensions we consider "static" (cache-first)
+12
src/calendar/index.html
··· 260 260 261 261 <div class="version-badge">v%APP_VERSION%</div> 262 262 <script type="module" src="./main.ts"></script> 263 + <script> 264 + // Service Worker registration for offline support 265 + if ('serviceWorker' in navigator) { 266 + var reloading = false; 267 + navigator.serviceWorker.addEventListener('controllerchange', function() { 268 + if (!reloading) { reloading = true; location.reload(); } 269 + }); 270 + navigator.serviceWorker.register('/sw.js', { updateViaCache: 'none' }).then(function(reg) { 271 + reg.update().catch(function() {}); 272 + }).catch(function() {}); 273 + } 274 + </script> 263 275 </body> 264 276 </html>
+12
src/diagrams/index.html
··· 186 186 187 187 <div class="version-badge">v%APP_VERSION%</div> 188 188 <script type="module" src="./main.ts"></script> 189 + <script> 190 + // Service Worker registration for offline support 191 + if ('serviceWorker' in navigator) { 192 + var reloading = false; 193 + navigator.serviceWorker.addEventListener('controllerchange', function() { 194 + if (!reloading) { reloading = true; location.reload(); } 195 + }); 196 + navigator.serviceWorker.register('/sw.js', { updateViaCache: 'none' }).then(function(reg) { 197 + reg.update().catch(function() {}); 198 + }).catch(function() {}); 199 + } 200 + </script> 189 201 </body> 190 202 </html>
+12
src/forms/index.html
··· 73 73 <div class="version-badge">v%APP_VERSION%</div> 74 74 75 75 <script type="module" src="./main.ts"></script> 76 + <script> 77 + // Service Worker registration for offline support 78 + if ('serviceWorker' in navigator) { 79 + var reloading = false; 80 + navigator.serviceWorker.addEventListener('controllerchange', function() { 81 + if (!reloading) { reloading = true; location.reload(); } 82 + }); 83 + navigator.serviceWorker.register('/sw.js', { updateViaCache: 'none' }).then(function(reg) { 84 + reg.update().catch(function() {}); 85 + }).catch(function() {}); 86 + } 87 + </script> 76 88 </body> 77 89 </html>
+12
src/slides/index.html
··· 99 99 100 100 <div class="version-badge">v%APP_VERSION%</div> 101 101 <script type="module" src="./main.ts"></script> 102 + <script> 103 + // Service Worker registration for offline support 104 + if ('serviceWorker' in navigator) { 105 + var reloading = false; 106 + navigator.serviceWorker.addEventListener('controllerchange', function() { 107 + if (!reloading) { reloading = true; location.reload(); } 108 + }); 109 + navigator.serviceWorker.register('/sw.js', { updateViaCache: 'none' }).then(function(reg) { 110 + reg.update().catch(function() {}); 111 + }).catch(function() {}); 112 + } 113 + </script> 102 114 </body> 103 115 </html>