You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
365 B
13 lines
365 B
import { Controller } from '@hotwired/stimulus' |
|
|
|
export default class extends Controller { |
|
connect() { |
|
if ('serviceWorker' in navigator) { |
|
navigator.serviceWorker.register('/service-worker.js') |
|
.then(() => { |
|
/* optional: console.debug('SW registered') */ |
|
}) |
|
.catch(err => console.error('SW failed:', err)); |
|
} |
|
} |
|
}
|
|
|