Until now remote WebUIs could only display websites that have been whitelisted in the game config.
To give you more freedom, servers can now request the client to whitelist additional domains. Only domain names with a top level domain (TLD) can be whitelisted.
Use the new function AddWebUIWhitelist in your index.lua or any other package script. When a player connects they will be asked.

Example whitelisting from the above picture:
--index.lua
AddWebUIWhitelist("vimeo.com")
AddWebUIWhitelist("vimeocdn.com")
AddWebUIWhitelist("firebaseio.com")
AddWebUIWhitelist("sentry-cdn.com")
AddWebUIWhitelist("vimeo.magisto.com")
AddWebUIWhitelist("akamaized.net")
The following Lua event is called in your scripts once the player reacted to the request screen:
-- The 1st parameter "domains" is a table containing the domains which the player allowed on the whitelist.
AddEvent("OnWhitelistAccepted", function(domains)
print("OnWhitelistAccepted", #domains)
for k, v in pairs(domains) do
print(k, v)
end
end)
The following Javascript functions are now called in your custom connect screen.
function OnDownloadComplete(file)
{
console.log("OnDownloadComplete " + file);
} // (string) msg: The message that is usually displayed to the player.
// (string) file: What file is currently being downloaded.
// (int) remaining_files: Number files still needed to download.
// (string) bytes_received: The number of bytes already received for the current file downloading as a string.
function OnDownloadProgress(msg, file, remaining_files, bytes_received)
{
console.log("OnDownloadProgress " + msg + " " + file + " " + parseInt(remaining_files) + " " + bytes_received)
}
Saving data on the client can be useful for some client settings. For example the ordering of an inventory in your UI.
Saving variables:
SetStorageValue("var_str", "Some long string variable")
SetStorageValue("var_int", 1337)
SetStorageValue("var_float", 3.1415)
SetStorageValue("var_bool", true)Reading variables:
print(GetStorageValue("var_str"))
print(GetStorageValue("var_int"))
print(GetStorageValue("var_float"))
print(GetStorageValue("var_bool"))Spawnable using the function CreateVehicle with vehicle model id 56.
