mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-06 01:45:22 +00:00
Add service worker and offline page (needed to install the webapp on mobile devices)
This commit is contained in:
@@ -19,5 +19,17 @@
|
||||
<body class="hold-transition login-page">
|
||||
{% block content %}{% endblock %}
|
||||
{% block scripts %}{% endblock %}
|
||||
|
||||
<script nonce="{{ JS_NONCE }}">
|
||||
// Initialize the service worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('serviceworker.js?v={{ FF_VERSION }}', {
|
||||
scope: '{{ route('index') }}'
|
||||
}).then(
|
||||
() => console.log('ServiceWorker registration successful'),
|
||||
(err) => console.log('ServiceWorker registration failed: ', err)
|
||||
);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user