@evan/webview

    0.0.2 • 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.close(); // close window
    window.wait(); // wait for window to close (blocks main thread)

    License

    Apache-2.0 © Evan

    Keywords

    none

    Install

    npm i @evan/webview

    DownloadsWeekly Downloads

    2

    Version

    0.0.2

    License

    Apache-2.0

    Unpacked Size

    2.77 MB

    Total Files

    10

    Last publish

    Collaborators

    • evan