Skip to content

Commit

Permalink
feat(theming): allow to disable standalone windows
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L. <[email protected]>
  • Loading branch information
szaimen committed Feb 5, 2025
1 parent 1407a1d commit c12f3c8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/theming/lib/Controller/ThemingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ public function getManifest(string $app): JSONResponse {
$startUrl = $this->urlGenerator->getBaseUrl() . '/apps/' . $app . '/';
}
$description = $info['summary'] ?? '';
$displayMode = $this->config->getSystemValueBool('theming.standalone_window.enabled', true) ? 'standalone' : 'browser';
}
/**
* @var string $description
Expand Down Expand Up @@ -481,7 +482,7 @@ public function getManifest(string $app): JSONResponse {
'sizes' => '16x16'
]
],
'display' => 'standalone'
'display' => $displayMode
];
$response = new JSONResponse($responseJS);
$response->cacheFor(3600);
Expand Down
5 changes: 5 additions & 0 deletions apps/theming/tests/Controller/ThemingControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,11 @@ public function testGetManifest(): void {
['theming.Icon.getTouchIcon', ['app' => 'core'], 'touchicon'],
['theming.Icon.getFavicon', ['app' => 'core'], 'favicon'],
]);
$this->config
->expects($this->once())
->method('getSystemValueBool')
->with('theming.standalone_window.enabled', true)
->willReturn(true);
$response = new JSONResponse([
'name' => 'Nextcloud',
'start_url' => 'localhost',
Expand Down
8 changes: 8 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,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

0 comments on commit c12f3c8

Please sign in to comment.