Merge pull request #50687 from nextcloud/backport/50666/stable30

[stable30] feat(theming): allow to disable standalone windows
pull/50726/head
Andy Scherzinger 2025-02-08 14:05:46 +07:00 committed by GitHub
commit 2447d53ee6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 3 deletions

@ -474,7 +474,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);

@ -705,7 +705,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')
@ -729,6 +737,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',
@ -745,7 +758,7 @@ class ThemingControllerTest extends TestCase {
'sizes' => '16x16'
]
],
'display' => 'standalone',
'display' => $standalone ? 'standalone' : 'browser',
'short_name' => 'Nextcloud',
'theme_color' => null,
'background_color' => null,

@ -2079,6 +2079,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