Vital.sandbox
Webview

webview.create

Client

Creates a new webview instance


Syntax

local instance = webview.create(options = {})

Parameters

TypeNameDescription
tableoptionsOptional configuration table
Refer Options section

Returns

TypeNameDescription
webviewinstanceCreated webview instance

Options

All fields are optional and fall back to their defaults if not specified.

FieldTypeDefaultDescription
fullscreenbooltrueWebview will always match the size of the viewport
transparentbooltrueWebview background will be transparent
incognitobooltrueRuns the webview in incognito mode, no data is persisted to disk
autoplayboolfalseMedia can be played without user interaction
zoomableboolfalseEnables page zooming hotkeys

Examples

Create a webview with default options
local browser = webview.create()

browser:set_visible(true)
browser:load_url("https://google.com")
Create a webview with custom options
local browser = webview.create({
    fullscreen = true,
    transparent = true,
    incognito = false,
    autoplay = false,
    zoomable = false
})

browser:set_visible(true)
browser:load_url("https://google.com")

On this page