Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

webview.close()

Closes the webview window and removes it from the application.

Parameters

None.

Returns

Promise<void> - Resolves when the webview has been closed

Description

The close() method removes the webview from the screen and cleans up its resources. If a close sound effect was configured when the webview was opened, it will be played before the webview is destroyed.

Example

import {Webview} from '@homunculus/sdk';

// Open a webview
const panel = await Webview.open({
    source: 'ui/settings.html',
});

// Use the webview...

// Close it when done
await panel.close();
console.log('Webview closed');