webview_deno icon indicating copy to clipboard operation
webview_deno copied to clipboard

Fullscreen API

Open jcc10 opened this issue 2 years ago • 2 comments

Full-screen API would be extremely useful.

The following is my test code:

import { Webview } from "https://deno.land/x/[email protected]/mod.ts";

const html = `
  <html>
  <body>
    <script>
      function testA() {
        document.getElementById("test").innerHTML = "Script";
        document.body.requestFullscreen();
      }
      function testB() {
        document.body.requestFullscreen();
        document.getElementById("test").innerHTML = "Fullscreen";
      }
    </script>
    <h1>Hello from deno v${Deno.version.deno}</h1>
    <h2 id="test">No Script</h2>
    <button onclick="testB()">Fullscreen</button>
    <script>testA();</script>
  </body>
  </html>
`;

const webview = new Webview();
webview.navigate(`data:text/html,${encodeURIComponent(html)}`);
webview.run();

Web API requires that the script has user input before allowing full-screen, however it would be more useful to not require it.

Alternatively it would be useful to trigger full-screen mode from the Deno process instead of from within the window.

jcc10 avatar Feb 09 '22 22:02 jcc10

https://github.com/webview/webview/issues/458

eliassjogreen avatar Feb 09 '22 23:02 eliassjogreen

Also minimize / maximize

justinmchase avatar Jul 08 '22 14:07 justinmchase