MDN self-hosted library · e01.org

Create a standalone app

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

css
.app-button {
  display: none;
}

@media (display-mode: standalone) {
  .app-button {
    display: block;
  }
}
js
function isStandaloneApp() {
  return window.matchMedia("(display-mode: standalone)").matches;
}