diff --git a/app.py b/app.py
index 027c549..a72ba23 100644
--- a/app.py
+++ b/app.py
@@ -58,7 +58,7 @@ def get_version() -> str:
@app.context_processor
def inject_version() -> Dict[str, str]:
"""Injects the version into all templates."""
- return dict(version=get_version())
+ return dict(version=get_version(), config=app.config, session=session)
@app.before_request
def make_session_permanent() -> None:
diff --git a/static/service-worker.js b/static/service-worker.js
index 524322d..84495ce 100644
--- a/static/service-worker.js
+++ b/static/service-worker.js
@@ -21,6 +21,19 @@ self.addEventListener('install', function(event) {
);
});
+self.addEventListener('push', function(event) {
+ const data = event.data.json();
+ const options = {
+ body: data.body,
+ icon: '/static/web-app-manifest-192x192.png',
+ badge: '/static/favicon-96x96.png'
+ };
+
+ event.waitUntil(
+ self.registration.showNotification(data.title, options)
+ );
+});
+
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
diff --git a/templates/base.html b/templates/base.html
index 7d897ce..f5bb5f7 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -54,8 +54,62 @@
{% block scripts %}{% endblock %}