@media all and (display-mode: standalone) {
/* Here goes the CSS rules that will only apply if app is running standalone */
}
这是 Javascript 方法(第 171-175 行、第 297-306 行)
function isRunningStandalone() {
return (window.matchMedia('(display-mode: standalone)').matches);
}
...
if (isRunningStandalone()) {
/* This code will be executed if app is running standalone */
}