diff --git a/client/css/bootstrap.css b/client/css/bootstrap.css index 5f41c698..768f6dac 100644 --- a/client/css/bootstrap.css +++ b/client/css/bootstrap.css @@ -44,7 +44,7 @@ audio:not([controls]) { } [hidden], template { - display: none; + display: none !important; } a { background: transparent; diff --git a/client/js/loading-error-handlers.js b/client/js/loading-error-handlers.js index 324fce68..79523547 100644 --- a/client/js/loading-error-handlers.js +++ b/client/js/loading-error-handlers.js @@ -60,4 +60,9 @@ }; window.addEventListener("error", window.g_LoungeErrorHandler); + + // Trigger early service worker registration + if ("serviceWorker" in navigator) { + navigator.serviceWorker.register("service-worker.js"); + } })(); diff --git a/client/js/socket-events/configuration.js b/client/js/socket-events/configuration.js index f354d789..afbaf67a 100644 --- a/client/js/socket-events/configuration.js +++ b/client/js/socket-events/configuration.js @@ -8,6 +8,18 @@ const webpush = require("../webpush"); const connect = $("#connect"); const utils = require("../utils"); +window.addEventListener("beforeinstallprompt", (installPromptEvent) => { + $("#webapp-install-button") + .on("click", function() { + if (installPromptEvent && installPromptEvent.prompt) { + installPromptEvent.prompt(); + } + + $(this).prop("hidden", true); + }) + .prop("hidden", false); +}); + socket.on("configuration", function(data) { if (options.initialized) { // Likely a reconnect, request sync for possibly missed settings. diff --git a/client/views/windows/settings.tpl b/client/views/windows/settings.tpl index 0443d1cf..ed9b9e93 100644 --- a/client/views/windows/settings.tpl +++ b/client/views/windows/settings.tpl @@ -15,6 +15,8 @@
+

Native app

+