OnClientBrowserCreated: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(added example)
mNo edit summary
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==  

Revision as of 22:18, 2 April 2018

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