Webview.url read/write property
Get the current Webview URL, a string.
Setting this property will cause navigation to the provided URL.
When setting this property while running in an embedded executable compiled with rtc
, and if the URL starts with file:///
, any resource not found locally will be searched inside the embedded content too.
Example
local ui = require "ui"
require "webview"
-- create a simple Webview
local win = ui.Window("Webview.url sample", 640, 480)
local addressbar = ui.Entry(win, "", 0, 6, 640, 24)
local Webview = ui.Webview(win, 0, 30, 640, 430)
function addressbar:onSelect()
Webview.url = addressbar.text
end
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible