@@ -10,6 +10,10 @@ import { join } from "path";
10
10
import { SiteSettingsKeys } from "@cocalc/util/db-schema/site-defaults" ;
11
11
import base_path from "@cocalc/backend/base-path" ;
12
12
13
+ // Control PWA installability -- https://github.com/sagemathinc/cocalc/issues/8474
14
+ // Keeps theme colors and styling but prevents Chrome's "Install app" prompt
15
+ const ENABLE_PWA_INSTALL = false ;
16
+
13
17
interface Custom {
14
18
configuration : Record < SiteSettingsKeys , string > ;
15
19
}
@@ -23,12 +27,11 @@ export function send(res: Response, custom: Custom) {
23
27
24
28
const base_app = join ( base_path , "app" ) ;
25
29
26
- const manifest = {
30
+ const manifest : any = {
27
31
name : config . site_name ,
28
32
short_name : config . site_name ,
29
33
start_url : `${ base_app } ?utm_medium=manifest` ,
30
34
scope : base_path ,
31
- display : "minimal-ui" ,
32
35
background_color : "#fbb635" ,
33
36
theme_color : "#4474c0" ,
34
37
description : config . site_description ,
@@ -43,5 +46,10 @@ export function send(res: Response, custom: Custom) {
43
46
] ,
44
47
} ;
45
48
49
+ // Without that display property, browsers won't show the "Install app" prompt
50
+ if ( ENABLE_PWA_INSTALL ) {
51
+ manifest . display = "minimal-ui" ;
52
+ }
53
+
46
54
res . send ( JSON . stringify ( manifest , null , 2 ) ) ;
47
55
}
0 commit comments