webview / webview_deno

🌐 Deno bindings for webview, a tiny library for creating web-based desktop GUIs
https://deno.land/x/webview
MIT License
1.44k stars 74 forks source link

Fullscreen API #101

Open jcc10 opened 2 years ago

jcc10 commented 2 years ago

Full-screen API would be extremely useful.

The following is my test code:

import { Webview } from "https://deno.land/x/webview@0.7.0-pre.0/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.

eliassjogreen commented 2 years ago

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

justinmchase commented 2 years ago

Also minimize / maximize