Skip to content

Window Fullscren doesnt work on deno #17

@cebrailakar

Description

@cebrailakar

code;

import { Application } from "npm:@webviewjs/webview";
const app = new Application();
const window = app.createBrowserWindow();

const webview = window.createWebview({
  html: `<!DOCTYPE html>
    <html>
        <head>
            <title>Webview</title>
        </head>
        <body>
            <h1 id="output">Hello world!</h1>
            <button id="btn">Click me!</button>
            <script>
                btn.onclick = function send() {
                    window.ipc.postMessage('Hello from webview');
                }
            </script>
        </body>
    </html>
    `,
  preload: `console.log("halow")`,
  x: 0,
  y: 0,
});

if (!webview.isDevtoolsOpen()) webview.openDevtools();

// deno-lint-ignore no-explicit-any
webview.onIpcMessage((data: any) => {
  const reply = `You sent ${data.body.toString("utf-8")}`;
  console.log(data);
  webview.evaluateScript(
    `document.getElementById("output").innerText = "${reply}"`
  );
  console.log(webview, window);
  (window as any).fullscreen();
});

app.run();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions