Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 49 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,53 @@ Robust cross-platform webview library for Node.js written in Rust. It is a nativ
> [!CAUTION]
> This library is still in development and not ready for production use. Feel free to experiment with it and report any issues you find.

See the [full documentation](./docs/) for API references, guides, platform
See the [full documentation](./) for API references, guides, platform
notes, and runnable examples.

# Documentation

## Getting started

| | |
| ------------------------------------------------------ | ------------------------------- |
| [Installation](./getting-started/installation) | System requirements and setup |
| [Quick Start](./getting-started/quick-start) | Your first window in minutes |
| [Event Loop](./getting-started/event-loop) | How the non-blocking pump works |

## API reference

| | |
| --------------------------------------------- | ------------------------------------------------------ |
| [Application](./api/application) | Root object — event loop, windows, menus |
| [BrowserWindow](./api/browser-window) | OS window, size, position, cursor, decorations |
| [Webview](./api/webview) | Embedded browser — navigation, cookies, script, bounds |
| [WebContext](./api/web-context) | Shared browser data, profiles, and automation |
| [System Tray](./api/tray) | Tray icons, menus, updates, and pointer events |
| [Menu](./api/menu) | Native menu bar construction |
| [Types](./api/types) | Shared interfaces and enums |

## Guides

| | |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [Building Executables](./guides/building-executables) | Compile to `.exe` / binary with node, deno, bun |
| [IPC Messaging](./guides/ipc-messaging) | Page ↔ Node communication |
| [Menus](./guides/menus) | Building menu bars with roles and accelerators |
| [Multiple Windows](./guides/multiple-windows) | Managing several windows |
| [Cookies & Storage](./guides/cookies-and-storage) | Reading, writing, and clearing cookies |
| [Custom Protocols](./guides/custom-protocols) | Serving local content to the webview |

## Platform notes

| | |
| ------------------------------------- | ----------------------------------------- |
| [Windows](./platform/windows) | WebView2, taskbar, DPI |
| [macOS](./platform/macos) | WebKit, main-thread requirement, app menu |
| [Linux](./platform/linux) | WebKitGTK, Wayland/X11, menu limitations |
| [iOS](./platform/ios) | Orientation, status bar, and gestures |
| [Android](./platform/android) | Content rectangle and configuration |


# Installation

```bash
Expand Down Expand Up @@ -105,7 +149,7 @@ app.whenReady().then(() => {
});
```

See the [system tray reference](./docs/api/tray.md) and
See the [system tray reference](./api/tray) and
[runnable tray example](./examples/tray.mjs).

## IPC and exposed functions
Expand Down Expand Up @@ -159,7 +203,7 @@ window.registerProtocol('app', async (request) => {
window.createWebview({ url: 'app://localhost/index.html' });
```

See [Custom Protocols](docs/guides/custom-protocols.md), [IPC](docs/guides/ipc-messaging.md), and the runnable [custom protocol](examples/custom-protocol.mjs) and [expose](examples/expose.mjs) examples.
See [Custom Protocols](docs/guides/custom-protocols), [IPC](docs/guides/ipc-messaging), and the runnable [custom protocol](examples/custom-protocol.mjs) and [expose](examples/expose.mjs) examples.

## Menu System

Expand Down Expand Up @@ -342,7 +386,7 @@ window.show(); // Show the window again
webview.reload();
```

For more details on closing applications and cleaning up resources, see the [Closing Guide](./docs/CLOSING_GUIDE.md).
For more details on closing applications and cleaning up resources, see the [Closing Guide](./CLOSING_GUIDE).

## Keep strong references

Expand Down Expand Up @@ -402,50 +446,7 @@ webview --build --runtime bun --input ./src/index.ts --name my-app
| `--name` / `-n` | `webviewjs` | Executable name |
| `--resources` / `-r` | — | JSON asset map (node only) |

For the full compilation guide including cross-compilation and code signing, see [Building Executables](./docs/guides/building-executables.md).

# Documentation

## Getting started

| | |
| ------------------------------------------------------ | ------------------------------- |
| [Installation](./docs/getting-started/installation.md) | System requirements and setup |
| [Quick Start](./docs/getting-started/quick-start.md) | Your first window in minutes |
| [Event Loop](./docs/getting-started/event-loop.md) | How the non-blocking pump works |

## API reference

| | |
| --------------------------------------------- | ------------------------------------------------------ |
| [Application](./docs/api/application.md) | Root object — event loop, windows, menus |
| [BrowserWindow](./docs/api/browser-window.md) | OS window, size, position, cursor, decorations |
| [Webview](./docs/api/webview.md) | Embedded browser — navigation, cookies, script, bounds |
| [WebContext](./docs/api/web-context.md) | Shared browser data, profiles, and automation |
| [System Tray](./docs/api/tray.md) | Tray icons, menus, updates, and pointer events |
| [Menu](./docs/api/menu.md) | Native menu bar construction |
| [Types](./docs/api/types.md) | Shared interfaces and enums |

## Guides

| | |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [Building Executables](./docs/guides/building-executables.md) | Compile to `.exe` / binary with node, deno, bun |
| [IPC Messaging](./docs/guides/ipc-messaging.md) | Page ↔ Node communication |
| [Menus](./docs/guides/menus.md) | Building menu bars with roles and accelerators |
| [Multiple Windows](./docs/guides/multiple-windows.md) | Managing several windows |
| [Cookies & Storage](./docs/guides/cookies-and-storage.md) | Reading, writing, and clearing cookies |
| [Custom Protocols](./docs/guides/custom-protocols.md) | Serving local content to the webview |

## Platform notes

| | |
| ------------------------------------- | ----------------------------------------- |
| [Windows](./docs/platform/windows.md) | WebView2, taskbar, DPI |
| [macOS](./docs/platform/macos.md) | WebKit, main-thread requirement, app menu |
| [Linux](./docs/platform/linux.md) | WebKitGTK, Wayland/X11, menu limitations |
| [iOS](./docs/platform/ios.md) | Orientation, status bar, and gestures |
| [Android](./docs/platform/android.md) | Content rectangle and configuration |
For the full compilation guide including cross-compilation and code signing, see [Building Executables](./guides/building-executables).

# Development

Expand Down
115 changes: 58 additions & 57 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![https://github.com/webviewjs/webview/actions](https://github.com/webviewjs/webview/workflows/CI/badge.svg)

Robust cross-platform webview library for Node.js written in Rust. It is a native binding to [winit](https://github.com/rust-windowing/winit) and [wry](https://github.com/tauri-apps/wry) allowing you to easily manage cross platform windowing and webview.
Robust cross-platform webview library for Node.js written in Rust. It is a native binding to [winit](https://github.com/rust-windowing/winit) and [wry](https://github.com/tauri-apps/wry) allowing you to create native desktop windows from JavaScript and TypeScript.

## Highlights

Expand All @@ -22,9 +22,53 @@ Robust cross-platform webview library for Node.js written in Rust. It is a nativ
> [!CAUTION]
> This library is still in development and not ready for production use. Feel free to experiment with it and report any issues you find.

See the [full documentation](./docs/) for API references, guides, platform
See the [full documentation](./) for API references, guides, platform
notes, and runnable examples.

# Documentation

## Getting started

| | |
| ------------------------------------------------------ | ------------------------------- |
| [Installation](./getting-started/installation) | System requirements and setup |
| [Quick Start](./getting-started/quick-start) | Your first window in minutes |
| [Event Loop](./getting-started/event-loop) | How the non-blocking pump works |

## API reference

| | |
| --------------------------------------------- | ------------------------------------------------------ |
| [Application](./api/application) | Root object — event loop, windows, menus |
| [BrowserWindow](./api/browser-window) | OS window, size, position, cursor, decorations |
| [Webview](./api/webview) | Embedded browser — navigation, cookies, script, bounds |
| [WebContext](./api/web-context) | Shared browser data, profiles, and automation |
| [System Tray](./api/tray) | Tray icons, menus, updates, and pointer events |
| [Menu](./api/menu) | Native menu bar construction |
| [Types](./api/types) | Shared interfaces and enums |

## Guides

| | |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [Building Executables](./guides/building-executables) | Compile to `.exe` / binary with node, deno, bun |
| [IPC Messaging](./guides/ipc-messaging) | Page ↔ Node communication |
| [Menus](./guides/menus) | Building menu bars with roles and accelerators |
| [Multiple Windows](./guides/multiple-windows) | Managing several windows |
| [Cookies & Storage](./guides/cookies-and-storage) | Reading, writing, and clearing cookies |
| [Custom Protocols](./guides/custom-protocols) | Serving local content to the webview |

## Platform notes

| | |
| ------------------------------------- | ----------------------------------------- |
| [Windows](./platform/windows) | WebView2, taskbar, DPI |
| [macOS](./platform/macos) | WebKit, main-thread requirement, app menu |
| [Linux](./platform/linux) | WebKitGTK, Wayland/X11, menu limitations |
| [iOS](./platform/ios) | Orientation, status bar, and gestures |
| [Android](./platform/android) | Content rectangle and configuration |


# Installation

```bash
Expand Down Expand Up @@ -105,8 +149,8 @@ app.whenReady().then(() => {
});
```

See the [system tray reference](./docs/api/tray.md) and
[runnable tray example](./examples/tray.mjs).
See the [system tray reference](./api/tray) and
[runnable tray example](../examples/tray.mjs).

## IPC and exposed functions

Expand Down Expand Up @@ -159,7 +203,7 @@ window.registerProtocol('app', async (request) => {
window.createWebview({ url: 'app://localhost/index.html' });
```

See [Custom Protocols](docs/guides/custom-protocols.md), [IPC](docs/guides/ipc-messaging.md), and the runnable [custom protocol](examples/custom-protocol.mjs) and [expose](examples/expose.mjs) examples.
See [Custom Protocols](./guides/custom-protocols), [IPC](./guides/ipc-messaging), and the runnable [custom protocol](../examples/custom-protocol.mjs) and [expose](../examples/expose.mjs) examples for more details.

## Menu System

Expand Down Expand Up @@ -342,7 +386,7 @@ window.show(); // Show the window again
webview.reload();
```

For more details on closing applications and cleaning up resources, see the [Closing Guide](./docs/CLOSING_GUIDE.md).
For more details on closing applications and cleaning up resources, see the [Closing Guide](./CLOSING_GUIDE).

## Keep strong references

Expand All @@ -367,13 +411,13 @@ true`, and method calls fail with a disposed error. Individual windows,
webviews, contexts, and tray icons also support `dispose()` and
`Symbol.dispose`.

Check out [examples](./examples) directory for more examples:
Check out [examples](../examples) directory for more examples:

- **[menu-system.mjs](./examples/menu-system.mjs)** - Comprehensive menu system demonstration with all features
- **[window-menus.mjs](./examples/window-menus.mjs)** - Window-specific vs global menu examples
- **[http/](./examples/http/)** - Serving content from a web server to webview
- **[transparent.mjs](./examples/transparent.mjs)** - Transparent window example
- **[close-example.mjs](./examples/close-example.mjs)** - Graceful application closing
- **[menu-system.mjs](../examples/menu-system.mjs)** - Comprehensive menu system demonstration with all features
- **[window-menus.mjs](../examples/window-menus.mjs)** - Window-specific vs global menu examples
- **[http/](../examples/http/)** - Serving content from a web server to webview
- **[transparent.mjs](../examples/transparent.mjs)** - Transparent window example
- **[close-example.mjs](../examples/close-example.mjs)** - Graceful application closing

Run any example with: `node examples/menu-system.mjs` (after building the project)

Expand Down Expand Up @@ -402,50 +446,7 @@ webview --build --runtime bun --input ./src/index.ts --name my-app
| `--name` / `-n` | `webviewjs` | Executable name |
| `--resources` / `-r` | — | JSON asset map (node only) |

For the full compilation guide including cross-compilation and code signing, see [Building Executables](./docs/guides/building-executables.md).

# Documentation

## Getting started

| | |
| ------------------------------------------------------ | ------------------------------- |
| [Installation](./docs/getting-started/installation.md) | System requirements and setup |
| [Quick Start](./docs/getting-started/quick-start.md) | Your first window in minutes |
| [Event Loop](./docs/getting-started/event-loop.md) | How the non-blocking pump works |

## API reference

| | |
| --------------------------------------------- | ------------------------------------------------------ |
| [Application](./docs/api/application.md) | Root object — event loop, windows, menus |
| [BrowserWindow](./docs/api/browser-window.md) | OS window, size, position, cursor, decorations |
| [Webview](./docs/api/webview.md) | Embedded browser — navigation, cookies, script, bounds |
| [WebContext](./docs/api/web-context.md) | Shared browser data, profiles, and automation |
| [System Tray](./docs/api/tray.md) | Tray icons, menus, updates, and pointer events |
| [Menu](./docs/api/menu.md) | Native menu bar construction |
| [Types](./docs/api/types.md) | Shared interfaces and enums |

## Guides

| | |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [Building Executables](./docs/guides/building-executables.md) | Compile to `.exe` / binary with node, deno, bun |
| [IPC Messaging](./docs/guides/ipc-messaging.md) | Page ↔ Node communication |
| [Menus](./docs/guides/menus.md) | Building menu bars with roles and accelerators |
| [Multiple Windows](./docs/guides/multiple-windows.md) | Managing several windows |
| [Cookies & Storage](./docs/guides/cookies-and-storage.md) | Reading, writing, and clearing cookies |
| [Custom Protocols](./docs/guides/custom-protocols.md) | Serving local content to the webview |

## Platform notes

| | |
| ------------------------------------- | ----------------------------------------- |
| [Windows](./docs/platform/windows.md) | WebView2, taskbar, DPI |
| [macOS](./docs/platform/macos.md) | WebKit, main-thread requirement, app menu |
| [Linux](./docs/platform/linux.md) | WebKitGTK, Wayland/X11, menu limitations |
| [iOS](./docs/platform/ios.md) | Orientation, status bar, and gestures |
| [Android](./docs/platform/android.md) | Content rectangle and configuration |
For the full compilation guide including cross-compilation and code signing, see [Building Executables](./guides/building-executables).

# Development

Expand All @@ -465,4 +466,4 @@ bun install

```bash
bun run build
```
```
6 changes: 3 additions & 3 deletions docs/api/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ interface ApplicationEvent {

### `createBrowserWindow(options?)`

Create and return a new [`BrowserWindow`](./browser-window.md).
Create and return a new [`BrowserWindow`](./browser-window).

```ts
app.createBrowserWindow(options?: BrowserWindowOptions): BrowserWindow
Expand All @@ -164,7 +164,7 @@ app.createWebContext(options?: WebContextOptions): WebContext
```

Create contexts through the application rather than with `new WebContext()`.
See the [WebContext reference](./web-context.md).
See the [WebContext reference](./web-context).

### `setMenu(options?)`

Expand All @@ -174,7 +174,7 @@ Set the global application menu. Pass `null` to remove it.
app.setMenu(options?: MenuOptions): void
```

See [Menus guide](../guides/menus.md) for the full options shape.
See [Menus guide](../guides/menus) for the full options shape.

This API remains supported. Compare its numeric event value with the exported
enum:
Expand Down
Loading
Loading