From 5b857bca21e1c2224603a5a171c4bed6fd8b3bb2 Mon Sep 17 00:00:00 2001 From: Simon L Date: Wed, 5 Feb 2025 14:37:08 +0100 Subject: [PATCH] feat(theming): allow to disable standalone windows Co-authored-by: Ferdinand Thiessen Signed-off-by: Simon L. [skip ci] --- apps/theming/lib/Controller/ThemingController.php | 2 +- apps/theming/tests/Controller/ThemingControllerTest.php | 2 +- config/config.sample.php | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 5b83d3bdb8b59..f26d2188c5e5d 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -474,7 +474,7 @@ public function getManifest(string $app): JSONResponse { 'sizes' => '16x16' ] ], - 'display' => 'standalone' + 'display' => $this->config->getSystemValueBool('theming.standalone_window.enabled', true) ? 'standalone' : 'browser' ]; $response = new JSONResponse($responseJS); $response->cacheFor(3600); diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index 629bc570032a7..6860c34914529 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -745,7 +745,7 @@ public function testGetManifest() { 'sizes' => '16x16' ] ], - 'display' => 'standalone', + 'display' => $standalone ? 'standalone' : 'browser', 'short_name' => 'Nextcloud', 'theme_color' => null, 'background_color' => null, diff --git a/config/config.sample.php b/config/config.sample.php index ac03cec50aacf..aaf3dba280917 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -2079,6 +2079,14 @@ */ 'enforce_theme' => '', + +/** + * This setting allows to disable the PWA functionality that allows browsers to open web applications in dedicated windows. + * + * Defaults to ``true`` + */ +'theming.standalone_window.enabled' => true, + /** * The default cipher for encrypting files. Currently supported are: * - AES-256-CTR