guiGetBrowser | Multi Theft Auto: Wiki Skip to content

guiGetBrowser

Client-side
Server-side
Shared

This function gets the browser element behind a gui-browser (a browser that has been created via guiCreateBrowser).

OOP Syntax Help! I don't understand this!

  • Method:gui-browser:getBrowser(...)
  • Variable: .browser

Syntax

browser guiGetBrowser ( ​gui-browser theBrowser )
Required arguments
  • theBrowser: The gui-browser.

Returns

Returns the browser element if a correct gui-browser has been passed, false otherwise.

  • browser: browser element

Code Examples

client

This examples get's browser element from gui-browser and attach a webbrowser to a CEGUI window.

-- Let's create a new browser in remote mode.
local window = guiCreateWindow(200, 200, 1024, 768, "Webbrowser", false)
local browser = guiCreateBrowser(0, 0, 800, 600, false, false, window)
-- The event onClientBrowserCreated will be triggered, after the browser has been initialized.
-- After this event has been triggered, we will be able to load our URL
local theBrowser = guiGetBrowser(browser) -- Get the browser element from gui-browser
addEventHandler("onClientBrowserCreated", theBrowser, function()
-- After the browser has been initialized, we can load www.youtube.com
loadBrowserURL(source, "http://www.youtube.com")
end)

See Also

GUI Functions