diff --git a/packages/api/src/webview.ts b/packages/api/src/webview.ts index da31a72eb..6a2857995 100644 --- a/packages/api/src/webview.ts +++ b/packages/api/src/webview.ts @@ -108,11 +108,23 @@ export type WebviewLabel = string * * // loading embedded asset: * const webview = new Webview(appWindow, 'theUniqueLabel', { - * url: 'path/to/page.html' + * url: 'path/to/page.html', + * + * // create a webview with specific logical position and size + * x: 0, + * y: 0, + * width: 800, + * height: 600, * }); * // alternatively, load a remote URL: * const webview = new Webview(appWindow, 'theUniqueLabel', { * url: 'https://github.com/tauri-apps/tauri' + * + * // create a webview with specific logical position and size + * x: 0, + * y: 0, + * width: 800, + * height: 600, * }); * * webview.once('tauri://created', function () { @@ -148,7 +160,13 @@ class Webview { * import { Webview } from '@tauri-apps/api/webview' * const appWindow = new Window('my-label') * const webview = new Webview(appWindow, 'my-label', { - * url: 'https://github.com/tauri-apps/tauri' + * url: 'https://github.com/tauri-apps/tauri', + * + * // create a webview with specific logical position and size + * x: 0, + * y: 0, + * width: 800, + * height: 600, * }); * webview.once('tauri://created', function () { * // webview successfully created