@lethevimlet/sshift 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -372,18 +372,14 @@ body {
372
372
  }
373
373
 
374
374
  .overflow-toggle {
375
- background: none;
376
- border: none;
377
- color: var(--text-secondary);
378
- padding: 8px;
379
- border-radius: var(--radius-sm);
380
375
  cursor: pointer;
381
- transition: var(--transition-fast);
382
376
  }
383
377
 
384
- .overflow-toggle:hover {
385
- background: var(--bg-hover);
386
- color: var(--text-primary);
378
+ /* Mobile-only controls in the tabs bar / sidebar (the mobile header is gone) */
379
+ /* (.btn sets display later in the file; keep specificity above it) */
380
+ .btn.mobile-bookmarks-btn,
381
+ .btn.sidebar-close-btn {
382
+ display: none;
387
383
  }
388
384
 
389
385
  .overflow-dropdown {
@@ -3453,7 +3449,9 @@ body.dragging-tabs .tabs-container {
3453
3449
  @media (max-width: 768px) {
3454
3450
  :root {
3455
3451
  --sidebar-width: 100%;
3456
- --header-height: 43px;
3452
+ /* No header on mobile (see .header below); everything that offsets
3453
+ by the header height (tabs bar, sidebar, keyboard math) gets 0. */
3454
+ --header-height: 0px;
3457
3455
  }
3458
3456
 
3459
3457
  /* Thinner xterm scrollbar on mobile */
@@ -3519,9 +3517,39 @@ body.dragging-tabs .tabs-container {
3519
3517
  display: none;
3520
3518
  }
3521
3519
 
3522
- /* Show mobile overflow menu on mobile */
3520
+ /* Show mobile overflow menu on mobile (lives in the tabs bar) */
3523
3521
  .mobile-overflow-menu {
3524
3522
  display: block;
3523
+ flex-shrink: 0;
3524
+ }
3525
+
3526
+ .tabs-actions .overflow-toggle {
3527
+ min-width: 28px;
3528
+ min-height: 28px;
3529
+ padding: 4px 6px;
3530
+ font-size: 12px;
3531
+ }
3532
+
3533
+ /* Mobile header is removed: the tabs bar is the only top bar. It holds
3534
+ bookmarks | tabs dropdown | resize | font -/+ | keys | mic | ... */
3535
+ .header {
3536
+ display: none;
3537
+ }
3538
+
3539
+ .btn.mobile-bookmarks-btn {
3540
+ display: flex;
3541
+ align-items: center;
3542
+ justify-content: center;
3543
+ min-width: 28px;
3544
+ min-height: 28px;
3545
+ padding: 4px 6px;
3546
+ margin-left: 4px;
3547
+ font-size: 12px;
3548
+ flex-shrink: 0;
3549
+ }
3550
+
3551
+ .btn.sidebar-close-btn {
3552
+ display: inline-flex;
3525
3553
  }
3526
3554
 
3527
3555
  /* Hide desktop tabs on mobile */
@@ -3529,10 +3557,12 @@ body.dragging-tabs .tabs-container {
3529
3557
  display: none;
3530
3558
  }
3531
3559
 
3532
- /* Show mobile tabs dropdown on mobile */
3560
+ /* Show mobile tabs dropdown on mobile. min-width: 0 lets it shrink
3561
+ (label ellipsis) so the bookmarks and overflow buttons fit. */
3533
3562
  .mobile-tabs-dropdown {
3534
3563
  display: flex;
3535
3564
  margin-left: 4px;
3565
+ min-width: 0;
3536
3566
  }
3537
3567
 
3538
3568
  .mobile-force-resize-btn {
@@ -3545,7 +3575,9 @@ body.dragging-tabs .tabs-container {
3545
3575
 
3546
3576
  .mobile-tabs-toggle {
3547
3577
  min-height: 28px;
3578
+ min-width: 0;
3548
3579
  padding: 4px 6px;
3580
+ gap: 6px;
3549
3581
  font-size: 12px;
3550
3582
  }
3551
3583
 
@@ -3694,7 +3726,8 @@ body.dragging-tabs .tabs-container {
3694
3726
  }
3695
3727
 
3696
3728
  /* Keep tabs-actions buttons at 32px for consistency */
3697
- .tabs-actions .btn-sm {
3729
+ .tabs-actions .btn-sm,
3730
+ .mobile-bookmarks-btn {
3698
3731
  min-height: 28px;
3699
3732
  min-width: 28px;
3700
3733
  padding: 4px 6px;
@@ -4493,10 +4526,11 @@ body.dragging-tabs .tabs-container {
4493
4526
  transform: none !important;
4494
4527
  }
4495
4528
 
4496
- /* Add padding to main-content to account for fixed header and tabs */
4529
+ /* Add padding to main-content to account for the fixed tabs bar
4530
+ (there is no header on mobile any more) */
4497
4531
  .main-content {
4498
- /* Header: 43px + 1px border, Tabs: 35px + 1px border = 80px total */
4499
- padding-top: 80px;
4532
+ /* Tabs bar: 37px incl. border */
4533
+ padding-top: 37px;
4500
4534
  /* Account for mobile keys bar at bottom - use padding-bottom */
4501
4535
  padding-bottom: 75px;
4502
4536
  }
@@ -4572,8 +4606,8 @@ body.dragging-tabs .tabs-container {
4572
4606
  }
4573
4607
 
4574
4608
  body.keyboard-visible .main-content {
4575
- /* Header and tabs stay fixed at top when keyboard is open */
4576
- padding-top: 80px !important;
4609
+ /* Tabs bar stays fixed at top when keyboard is open (no header) */
4610
+ padding-top: 37px !important;
4577
4611
  /* Remove bottom padding since mobile keys bar is positioned above keyboard */
4578
4612
  padding-bottom: 0 !important;
4579
4613
  }
@@ -10,6 +10,7 @@
10
10
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
11
11
  <meta name="apple-mobile-web-app-title" content="SSHIFT">
12
12
  <link rel="manifest" href="/manifest.json?v=__VERSION__">
13
+ <script>window.SSHIFT_VERSION = '__VERSION__';</script>
13
14
  <link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
14
15
  <link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
15
16
  <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
@@ -169,108 +170,6 @@
169
170
  </button>
170
171
  </div>
171
172
 
172
- <!-- Mobile overflow menu -->
173
- <div class="mobile-overflow-menu" id="mobileOverflowMenu">
174
- <button class="btn btn-icon overflow-toggle" id="overflowToggle" title="More Options">
175
- <i class="fas fa-ellipsis-v"></i>
176
- </button>
177
- <div class="overflow-dropdown" id="overflowDropdown">
178
- <button class="overflow-option" id="mobileThemeToggle">
179
- <i class="fas fa-lightbulb"></i>
180
- <span id="mobileThemeToggleText">Toggle Dark</span>
181
- </button>
182
- <div class="overflow-submenu" id="mobileAccentSubmenu">
183
- <button class="overflow-option submenu-toggle">
184
- <span class="accent-preview"></span>
185
- <span>Accent Color</span>
186
- <i class="fas fa-chevron-right submenu-arrow"></i>
187
- </button>
188
- <div class="submenu-content accent-submenu">
189
- <button class="accent-option" data-accent="fuchsia">
190
- <span class="accent-color" style="background: #c10059;"></span>
191
- <span class="accent-label">Fuchsia</span>
192
- </button>
193
- <button class="accent-option" data-accent="green">
194
- <span class="accent-color" style="background: #2ea043;"></span>
195
- <span class="accent-label">Green</span>
196
- </button>
197
- <button class="accent-option" data-accent="purple">
198
- <span class="accent-color" style="background: #a371f2;"></span>
199
- <span class="accent-label">Purple</span>
200
- </button>
201
- <button class="accent-option" data-accent="orange">
202
- <span class="accent-color" style="background: #d18616;"></span>
203
- <span class="accent-label">Orange</span>
204
- </button>
205
- <button class="accent-option" data-accent="red">
206
- <span class="accent-color" style="background: #da3633;"></span>
207
- <span class="accent-label">Red</span>
208
- </button>
209
- <button class="accent-option" data-accent="cyan">
210
- <span class="accent-color" style="background: #1f6feb;"></span>
211
- <span class="accent-label">Cyan</span>
212
- </button>
213
- <button class="accent-option" data-accent="blue">
214
- <span class="accent-color" style="background: #58a6ff;"></span>
215
- <span class="accent-label">Blue</span>
216
- </button>
217
- <button class="accent-option" data-accent="yellow">
218
- <span class="accent-color" style="background: #d29922;"></span>
219
- <span class="accent-label">Yellow</span>
220
- </button>
221
- </div>
222
- </div>
223
- <div class="overflow-submenu" id="mobileTerminalColorSubmenu">
224
- <button class="overflow-option submenu-toggle">
225
- <i class="fas fa-palette"></i>
226
- <span>Terminal Colors</span>
227
- <i class="fas fa-chevron-right submenu-arrow"></i>
228
- </button>
229
- <div class="submenu-content terminal-color-submenu">
230
- <div class="terminal-color-option">
231
- <label class="toggle-label">
232
- <span>Override Colors</span>
233
- <input type="checkbox" id="mobileTerminalColorOverride" class="toggle-checkbox">
234
- <span class="toggle-slider"></span>
235
- </label>
236
- </div>
237
- <div class="terminal-color-options" id="mobileTerminalColorOptions">
238
- <div class="terminal-color-option">
239
- <label for="mobileTerminalBgColor">Background</label>
240
- <div class="color-input-group">
241
- <input type="color" id="mobileTerminalBgColor" class="color-input" value="#0d1117">
242
- <button type="button" class="color-reset-btn" data-color-target="bg" title="Restore default background">
243
- <i class="fas fa-rotate-left"></i>
244
- </button>
245
- </div>
246
- </div>
247
- <div class="terminal-color-option">
248
- <label for="mobileTerminalFgColor">Foreground</label>
249
- <div class="color-input-group">
250
- <input type="color" id="mobileTerminalFgColor" class="color-input" value="#e6edf3">
251
- <button type="button" class="color-reset-btn" data-color-target="fg" title="Restore default foreground">
252
- <i class="fas fa-rotate-left"></i>
253
- </button>
254
- </div>
255
- </div>
256
- <div class="terminal-color-option">
257
- <label for="mobileTerminalSelectionColor">Selection</label>
258
- <div class="color-input-group">
259
- <input type="color" id="mobileTerminalSelectionColor" class="color-input" value="#264f78">
260
- <button type="button" class="color-reset-btn" data-color-target="selection" title="Restore default selection color">
261
- <i class="fas fa-rotate-left"></i>
262
- </button>
263
- </div>
264
- </div>
265
- </div>
266
- </div>
267
- </div>
268
- <button class="overflow-option" id="mobileSettingsBtn">
269
- <i class="fas fa-cog"></i>
270
- <span>Settings</span>
271
- </button>
272
- </div>
273
- </div>
274
173
  </div>
275
174
  </header>
276
175
 
@@ -290,6 +189,9 @@
290
189
  <button class="btn btn-sm sidebar-toggle desktop-only" id="sidebarToggle" title="Collapse Sidebar">
291
190
  <i class="fas fa-chevron-left"></i>
292
191
  </button>
192
+ <button class="btn btn-sm sidebar-close-btn" id="sidebarCloseBtn" title="Close">
193
+ <i class="fas fa-times"></i>
194
+ </button>
293
195
  </div>
294
196
  </div>
295
197
  <div class="bookmarks-list" id="bookmarksList">
@@ -318,6 +220,10 @@
318
220
  <div class="layout-panel" id="panel-0" data-panel-id="0">
319
221
  <!-- Tabs -->
320
222
  <div class="tabs-container">
223
+ <!-- Mobile: bookmarks (sidebar) button — replaces the mobile header -->
224
+ <button class="btn btn-sm mobile-bookmarks-btn" id="mobileBookmarksBtn" title="Bookmarks">
225
+ <i class="fas fa-bookmark"></i>
226
+ </button>
321
227
  <!-- Desktop tabs -->
322
228
  <div class="tabs" id="tabs">
323
229
  <!-- Tabs will be added here -->
@@ -358,6 +264,109 @@
358
264
  <button class="btn btn-sm" id="speechToTextBtn" title="Speech to Text">
359
265
  <i class="fas fa-microphone"></i>
360
266
  </button>
267
+ <!-- Mobile overflow menu -->
268
+ <div class="mobile-overflow-menu" id="mobileOverflowMenu">
269
+ <button class="btn btn-sm overflow-toggle" id="overflowToggle" title="More Options">
270
+ <i class="fas fa-ellipsis-v"></i>
271
+ </button>
272
+ <div class="overflow-dropdown" id="overflowDropdown">
273
+ <button class="overflow-option" id="mobileThemeToggle">
274
+ <i class="fas fa-lightbulb"></i>
275
+ <span id="mobileThemeToggleText">Toggle Dark</span>
276
+ </button>
277
+ <div class="overflow-submenu" id="mobileAccentSubmenu">
278
+ <button class="overflow-option submenu-toggle">
279
+ <span class="accent-preview"></span>
280
+ <span>Accent Color</span>
281
+ <i class="fas fa-chevron-right submenu-arrow"></i>
282
+ </button>
283
+ <div class="submenu-content accent-submenu">
284
+ <button class="accent-option" data-accent="fuchsia">
285
+ <span class="accent-color" style="background: #c10059;"></span>
286
+ <span class="accent-label">Fuchsia</span>
287
+ </button>
288
+ <button class="accent-option" data-accent="green">
289
+ <span class="accent-color" style="background: #2ea043;"></span>
290
+ <span class="accent-label">Green</span>
291
+ </button>
292
+ <button class="accent-option" data-accent="purple">
293
+ <span class="accent-color" style="background: #a371f2;"></span>
294
+ <span class="accent-label">Purple</span>
295
+ </button>
296
+ <button class="accent-option" data-accent="orange">
297
+ <span class="accent-color" style="background: #d18616;"></span>
298
+ <span class="accent-label">Orange</span>
299
+ </button>
300
+ <button class="accent-option" data-accent="red">
301
+ <span class="accent-color" style="background: #da3633;"></span>
302
+ <span class="accent-label">Red</span>
303
+ </button>
304
+ <button class="accent-option" data-accent="cyan">
305
+ <span class="accent-color" style="background: #1f6feb;"></span>
306
+ <span class="accent-label">Cyan</span>
307
+ </button>
308
+ <button class="accent-option" data-accent="blue">
309
+ <span class="accent-color" style="background: #58a6ff;"></span>
310
+ <span class="accent-label">Blue</span>
311
+ </button>
312
+ <button class="accent-option" data-accent="yellow">
313
+ <span class="accent-color" style="background: #d29922;"></span>
314
+ <span class="accent-label">Yellow</span>
315
+ </button>
316
+ </div>
317
+ </div>
318
+ <div class="overflow-submenu" id="mobileTerminalColorSubmenu">
319
+ <button class="overflow-option submenu-toggle">
320
+ <i class="fas fa-palette"></i>
321
+ <span>Terminal Colors</span>
322
+ <i class="fas fa-chevron-right submenu-arrow"></i>
323
+ </button>
324
+ <div class="submenu-content terminal-color-submenu">
325
+ <div class="terminal-color-option">
326
+ <label class="toggle-label">
327
+ <span>Override Colors</span>
328
+ <input type="checkbox" id="mobileTerminalColorOverride" class="toggle-checkbox">
329
+ <span class="toggle-slider"></span>
330
+ </label>
331
+ </div>
332
+ <div class="terminal-color-options" id="mobileTerminalColorOptions">
333
+ <div class="terminal-color-option">
334
+ <label for="mobileTerminalBgColor">Background</label>
335
+ <div class="color-input-group">
336
+ <input type="color" id="mobileTerminalBgColor" class="color-input" value="#0d1117">
337
+ <button type="button" class="color-reset-btn" data-color-target="bg" title="Restore default background">
338
+ <i class="fas fa-rotate-left"></i>
339
+ </button>
340
+ </div>
341
+ </div>
342
+ <div class="terminal-color-option">
343
+ <label for="mobileTerminalFgColor">Foreground</label>
344
+ <div class="color-input-group">
345
+ <input type="color" id="mobileTerminalFgColor" class="color-input" value="#e6edf3">
346
+ <button type="button" class="color-reset-btn" data-color-target="fg" title="Restore default foreground">
347
+ <i class="fas fa-rotate-left"></i>
348
+ </button>
349
+ </div>
350
+ </div>
351
+ <div class="terminal-color-option">
352
+ <label for="mobileTerminalSelectionColor">Selection</label>
353
+ <div class="color-input-group">
354
+ <input type="color" id="mobileTerminalSelectionColor" class="color-input" value="#264f78">
355
+ <button type="button" class="color-reset-btn" data-color-target="selection" title="Restore default selection color">
356
+ <i class="fas fa-rotate-left"></i>
357
+ </button>
358
+ </div>
359
+ </div>
360
+ </div>
361
+ </div>
362
+ </div>
363
+ <button class="overflow-option" id="mobileSettingsBtn">
364
+ <i class="fas fa-cog"></i>
365
+ <span>Settings</span>
366
+ </button>
367
+ </div>
368
+ </div>
369
+
361
370
  </div>
362
371
  </div>
363
372
 
@@ -1277,13 +1286,13 @@
1277
1286
  <div class="setting-item" style="flex-direction: column; align-items: stretch;">
1278
1287
  <label class="setting-label"><i class="fas fa-lock"></i> SSL Certificate</label>
1279
1288
  <div class="setting-description">
1280
- Service workers require a trusted HTTPS connection. To use this app over LAN with a self-signed certificate, install the certificate as a trusted root CA on your device. See the <a href="https://lethevimlet.github.io/sshift/installation.html#trusting-the-https-certificate" target="_blank" rel="noopener noreferrer" class="sw-install-link">installation instructions</a> for details.
1289
+ Service workers require a trusted HTTPS connection. sshift signs its HTTPS certificate with its own local CA; install that CA once on each device (Android: Settings → Security → Encryption &amp; credentials → Install a certificate → CA certificate) and the warnings go away. If the download is blocked, open <code>http://&lt;host&gt;:&lt;port&gt;/api/cert</code> over plain HTTP. See the <a href="https://lethevimlet.github.io/sshift/installation.html#trusting-the-https-certificate" target="_blank" rel="noopener noreferrer" class="sw-install-link">installation instructions</a> for details.
1281
1290
  </div>
1282
1291
  <div id="customCertWarning" class="sw-custom-cert-warning" style="display: none; margin-top: 8px;">
1283
1292
  <i class="fas fa-exclamation-circle"></i> A custom certificate is configured. Download the certificate from your administrator.
1284
1293
  </div>
1285
1294
  <button class="btn btn-secondary" id="downloadCertBtn" style="margin-top: 8px;">
1286
- <i class="fas fa-download"></i> Download Certificate
1295
+ <i class="fas fa-download"></i> Download CA Certificate
1287
1296
  </button>
1288
1297
  </div>
1289
1298
  </div>
@@ -1330,6 +1339,10 @@
1330
1339
  <span class="debug-info-label">SSL Private Key</span>
1331
1340
  <span class="debug-info-value" id="debugKeyPath">Loading...</span>
1332
1341
  </div>
1342
+ <div class="debug-info-item">
1343
+ <span class="debug-info-label">Local CA Certificate</span>
1344
+ <span class="debug-info-value" id="debugCaCertPath">Loading...</span>
1345
+ </div>
1333
1346
  <div class="debug-info-item">
1334
1347
  <span class="debug-info-label">Certificate Type</span>
1335
1348
  <span class="debug-info-value" id="debugCertType">Loading...</span>
@@ -1337,6 +1350,9 @@
1337
1350
  </div>
1338
1351
  </div>
1339
1352
  <div class="modal-footer">
1353
+ <button class="btn btn-secondary" id="copyInputTraceBtn" title="Copy the last mobile keyboard/IME events (for Gboard bug reports)">
1354
+ <i class="fas fa-clipboard"></i> Copy Input Trace
1355
+ </button>
1340
1356
  <button class="btn btn-primary" id="closeDebugInfoBtn">
1341
1357
  <i class="fas fa-check"></i> Close
1342
1358
  </button>
@@ -1553,51 +1569,77 @@
1553
1569
  <script src="/socket.io/socket.io.js"></script>
1554
1570
  <script src="/js/app.js?v=__VERSION__"></script>
1555
1571
  <script>
1572
+ // Service worker lifecycle (v1.8.2).
1573
+ // - sw.js is served with no-store and registered with updateViaCache
1574
+ // 'none', so every update check hits the server.
1575
+ // - Chrome only checks for a new worker on navigations; a PWA that
1576
+ // stays open never navigates, so we also check when the app comes
1577
+ // back to the foreground and once an hour.
1578
+ // - The worker calls skipWaiting()+clients.claim(): the moment a new
1579
+ // version installs it replaces the old one everywhere (never two
1580
+ // versions alive), and every open page reloads exactly once on
1581
+ // controllerchange so HTML, JS, CSS and worker all match.
1556
1582
  if ('serviceWorker' in navigator) {
1557
- window.addEventListener('load', () => {
1558
- navigator.serviceWorker.register('/sw.js').then((reg) => {
1559
- console.log('[SSHIFT] Service Worker registered, scope:', reg.scope);
1560
- window._swRegistration = reg;
1561
- if (reg.active) {
1583
+ const hadController = !!navigator.serviceWorker.controller;
1584
+ let reloading = false;
1585
+ navigator.serviceWorker.addEventListener('controllerchange', () => {
1586
+ if (reloading) return;
1587
+ // First install: this page already has the current assets.
1588
+ if (!hadController && !window.__swUpdateSeen) {
1562
1589
  window._swStatus = 'active';
1563
- } else if (reg.installing) {
1564
- window._swStatus = 'installing';
1565
- } else if (reg.waiting) {
1566
- window._swStatus = 'waiting';
1567
- } else {
1568
- window._swStatus = 'registered';
1590
+ return;
1569
1591
  }
1570
- window._swError = null;
1571
- reg.addEventListener('updatefound', () => {
1572
- const newWorker = reg.installing;
1573
- newWorker.addEventListener('statechange', () => {
1574
- if (newWorker.state === 'activated') {
1575
- window._swStatus = 'active';
1576
- if (navigator.serviceWorker.controller) {
1577
- console.log('[SSHIFT] New service worker activated, reloading for updates');
1578
- window.location.reload();
1579
- }
1580
- } else if (newWorker.state === 'redundant') {
1581
- if (!navigator.serviceWorker.controller) {
1582
- window._swStatus = 'redundant';
1583
- window._swError = 'Service Worker became redundant. This usually means the certificate is not trusted.';
1592
+ reloading = true;
1593
+ console.log('[SSHIFT] New service worker took control, reloading for the new version');
1594
+ window.location.reload();
1595
+ });
1596
+ window.addEventListener('load', () => {
1597
+ navigator.serviceWorker.register('/sw.js', { updateViaCache: 'none' }).then((reg) => {
1598
+ console.log('[SSHIFT] Service Worker registered, scope:', reg.scope);
1599
+ window._swRegistration = reg;
1600
+ if (reg.active) {
1601
+ window._swStatus = 'active';
1602
+ } else if (reg.installing) {
1603
+ window._swStatus = 'installing';
1604
+ } else if (reg.waiting) {
1605
+ window._swStatus = 'waiting';
1606
+ } else {
1607
+ window._swStatus = 'registered';
1608
+ }
1609
+ window._swError = null;
1610
+ reg.addEventListener('updatefound', () => {
1611
+ const newWorker = reg.installing;
1612
+ if (!newWorker) return;
1613
+ // An update while we already had a controller: the coming
1614
+ // controllerchange must reload.
1615
+ if (navigator.serviceWorker.controller) window.__swUpdateSeen = true;
1616
+ newWorker.addEventListener('statechange', () => {
1617
+ if (newWorker.state === 'activated') {
1618
+ window._swStatus = 'active';
1619
+ } else if (newWorker.state === 'redundant') {
1620
+ if (!navigator.serviceWorker.controller) {
1621
+ window._swStatus = 'redundant';
1622
+ window._swError = 'Service Worker became redundant. This usually means the certificate is not trusted.';
1623
+ }
1584
1624
  }
1585
- }
1625
+ });
1586
1626
  });
1627
+ if (navigator.serviceWorker.controller) {
1628
+ window._swStatus = 'active';
1629
+ }
1630
+ const check = () => { reg.update().catch(() => {}); };
1631
+ document.addEventListener('visibilitychange', () => { if (!document.hidden) check(); });
1632
+ setInterval(check, 60 * 60 * 1000);
1633
+ }).catch((err) => {
1634
+ console.warn('[SSHIFT] Service Worker registration failed:', err.message);
1635
+ window._swStatus = 'failed';
1636
+ window._swError = err.message;
1587
1637
  });
1588
- if (navigator.serviceWorker.controller) {
1589
- window._swStatus = 'active';
1590
- }
1591
- }).catch((err) => {
1592
- console.warn('[SSHIFT] Service Worker registration failed:', err.message);
1593
- window._swStatus = 'failed';
1594
- window._swError = err.message;
1595
1638
  });
1596
- });
1597
- } else {
1598
- window._swStatus = 'unsupported';
1599
- window._swError = 'Service Workers not supported in this browser';
1600
- }
1639
+ } else {
1640
+ window._swStatus = 'unsupported';
1641
+ window._swError = 'Service Workers not supported in this browser';
1642
+ }
1601
1643
  </script>
1602
1644
  </body>
1603
1645
  </html>