display-override-member-media-feature-standalone-manual.tentative.html (1083B)
1 <!DOCTYPE html> 2 <title>Test "standalone" in display-override member + media feature</title> 3 <link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" /> 4 <link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-standalone" /> 5 <link rel="manifest" href="resources/display-override-member-media-feature-standalone.webmanifest" /> 6 <script src="resources/display-override-member-media-feature-manual.js"></script> 7 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 <h1>Test "standalone" in display-override member + media feature</h1> 9 <style> 10 .fail { 11 background-color: red; 12 } 13 14 @media all and (display-mode: standalone) { 15 body { 16 background-color: green; 17 } 18 } 19 </style> 20 <script> 21 const standalone = matchMedia("(display-mode: standalone)"); 22 23 standalone.onchange = () => { 24 if (standalone.matches) { 25 document.body.classList.remove("fail"); 26 } 27 } 28 29 if (!standalone.matches) { 30 document.body.classList.add("fail"); 31 } 32 </script> 33 <p> 34 To pass, the background color must be green after installing. 35 </p>