@evan/webview

0.0.3 • Public • Published

@evan/webview

webview bindings for bun runtime

Install

bun add @evan/webview


Examples

import { Window } from '@evan/webview';

// window is bound to bun's lifetime
// window will not prevent bun from exiting
const window = new Window({
  titlebar: true, // enable/disable titlebar (default: true) [macos-only]
  resizable: true, // enable/disable resizing window (default: true)
  maximized: false, // start window maximized (default: false)
  fullscreen: false, // start window in fullscreen mode (default: false)
  title: 'Hello World', // set window's title (default: none)
  always_on_top: false, // keep window always on top (default: false)
  user_agent: 'bun!!!!', // set user agent (default: webkit's user agent)

  js: 'console.log(1)', // inject js code before loading url/html (default: none)
  url: 'https://www.google.com', // start window with url (default: blank)
  // or html: '<h1>Hello World</h1>', // start window with html (default: "")

  size: {
    width: 800, height: 600, // default window size
    min: { width: 400, height: 300 }, // min window size
    max: { width: 1024, height: 768 }, // max window size
  },
});

window.kill(); // close webview window
window.wait(); // wait for window to close (blocks main thread)

License

Apache-2.0 © Evan

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @evan/webview

      Weekly Downloads

      1

      Version

      0.0.3

      License

      Apache-2.0

      Unpacked Size

      2.76 MB

      Total Files

      11

      Last publish

      Collaborators

      • evan