3 namespace BookStack\App;
5 class PwaManifestBuilder
7 public function build(): array
9 // Note, while we attempt to use the user's preference here, the request to the manifest
10 // does not start a session, so we won't have current user context.
11 // This was attempted but removed since manifest calls could affect user session
12 // history tracking and back redirection.
13 // Context: https://github.com/BookStackApp/BookStack/issues/4649
14 $darkMode = (bool) setting()->getForCurrentUser('dark-mode-enabled');
15 $appName = setting('app-name');
19 "short_name" => $appName,
22 "display" => "standalone",
23 "background_color" => $darkMode ? '#111111' : '#F2F2F2',
24 "description" => $appName,
25 "theme_color" => ($darkMode ? setting('app-color-dark') : setting('app-color')),
27 "client_mode" => "focus-existing"
29 "orientation" => "any",
32 "src" => setting('app-icon-32') ?: url('/icon-32.png'),
37 "src" => setting('app-icon-64') ?: url('/icon-64.png'),
42 "src" => setting('app-icon-128') ?: url('/icon-128.png'),
47 "src" => setting('app-icon-180') ?: url('/icon-180.png'),
52 "src" => setting('app-icon') ?: url('/icon.png'),
57 "src" => url('favicon.ico'),
59 "type" => "image/vnd.microsoft.icon"