OnClientBrowserCreated: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
{{New feature/item|3.0150|1.5||
{{New feature/item|3.0150|1.5||
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.  
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.  
{{Note|Calling loadBrowserURL right after [[createBrowser]] will not work normally due to the nature of the asynchronous browser interface.}}
{{Note|Calling loadBrowserURL right after [[createBrowser]] will not work normally due to the nature of the asynchronous browser interface.}}
}}
}}


==Parameters==  
==Parameters==  
None
No parameters.


==Source==
==Source==
The [[Element/Browser|browser]] element
The [[Element/Browser|browser]] element.


==Example==  
==Example==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
TODO
addEventHandler("onClientBrowserCreated", resourceRoot,
function ()
    -- when the browser is loaded
    loadBrowserURL(source, "http://mtasa.com") -- load MTA:SA site
end)
</syntaxhighlight>
</syntaxhighlight>
[[pl:onClientBrowserCreated]]


==See Also==
==See Also==
{{CEF_events}}
{{CEF_events}}

Latest revision as of 11:01, 4 July 2020

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.

[[{{{image}}}|link=|]] Note: Calling loadBrowserURL right after createBrowser will not work normally due to the nature of the asynchronous browser interface.

Parameters

No parameters.

Source

The browser element.

Example

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

See Also