Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/theming/lib/Controller/ThemingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,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);
Expand Down
17 changes: 15 additions & 2 deletions apps/theming/tests/Controller/ThemingControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,15 @@ public function testGetLoginBackground() {
@$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')
Expand All @@ -769,6 +777,11 @@ public function testGetManifest() {
'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',
Expand All @@ -785,7 +798,7 @@ public function testGetManifest() {
'sizes' => '16x16'
]
],
'display' => 'standalone',
'display' => $standalone ? 'standalone' : 'browser',
'short_name' => 'Nextcloud',
'theme_color' => null,
'background_color' => null,
Expand Down
8 changes: 8 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,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
Expand Down
Loading