diff options
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 2 | ||||
-rw-r--r-- | apps/theming/tests/Controller/ThemingControllerTest.php | 17 | ||||
-rw-r--r-- | config/config.sample.php | 8 |
3 files changed, 24 insertions, 3 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 91012d1e37a..2a6080a8f65 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -506,7 +506,7 @@ class ThemingController extends Controller { '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 5bc27069c6e..7b8ef85e663 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -732,7 +732,15 @@ class ThemingControllerTest extends TestCase { @$this->assertEquals($expected, $this->themingController->getImage('background')); } - public function testGetManifest() { + public static function dataGetManifest(): array { + return [ + [true], + [false], + ]; + } + + /** @dataProvider dataGetManifest */ + public function testGetManifest(bool $standalone) { $this->config ->expects($this->once()) ->method('getAppValue') @@ -756,6 +764,11 @@ class ThemingControllerTest extends TestCase { 'touchicon', 'favicon', ); + $this->config + ->expects($this->once()) + ->method('getSystemValueBool') + ->with('theming.standalone_window.enabled', true) + ->willReturn($standalone); $response = new Http\JSONResponse([ 'name' => 'Nextcloud', 'start_url' => 'localhost', @@ -772,7 +785,7 @@ class ThemingControllerTest extends TestCase { '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 0ae13c3dd00..03ecd2df346 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1984,6 +1984,14 @@ $CONFIG = [ */ '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 |