@@ -10,6 +10,10 @@ import { join } from "path";
1010import { SiteSettingsKeys } from "@cocalc/util/db-schema/site-defaults" ;
1111import base_path from "@cocalc/backend/base-path" ;
1212
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+
1317interface Custom {
1418 configuration : Record < SiteSettingsKeys , string > ;
1519}
@@ -23,12 +27,11 @@ export function send(res: Response, custom: Custom) {
2327
2428 const base_app = join ( base_path , "app" ) ;
2529
26- const manifest = {
30+ const manifest : any = {
2731 name : config . site_name ,
2832 short_name : config . site_name ,
2933 start_url : `${ base_app } ?utm_medium=manifest` ,
3034 scope : base_path ,
31- display : "minimal-ui" ,
3235 background_color : "#fbb635" ,
3336 theme_color : "#4474c0" ,
3437 description : config . site_description ,
@@ -43,5 +46,10 @@ export function send(res: Response, custom: Custom) {
4346 ] ,
4447 } ;
4548
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+
4654 res . send ( JSON . stringify ( manifest , null , 2 ) ) ;
4755}
0 commit comments