onClientBrowserCreated | Multi Theft Auto: Wiki Skip to content

onClientBrowserCreated

Client-side
Server-side
Shared

This event is triggered when the CEF browser instance has been created. If you want to load a specific website right after creating the browser (using createBrowser or guiCreateBrowser), this event will be the convenient place.

Calling loadBrowserURL right after createBrowser will not work normally due to the nature of the asynchronous browser interface.

Parameters

This event does not pass any parameters to the handler function.

Source

element: The browser element.

Code Examples

client
addEventHandler("onClientBrowserCreated", resourceRoot,
function ()
-- when the browser is loaded
loadBrowserURL(source, "http://mtasa.com") -- load MTA:SA site
end)