GetBrowserURL

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

Accessories-text-editor.png Script Example Missing Function GetBrowserURL needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.

This function returns the URL of the specified browser.

Syntax

string getBrowserURL ( browser webBrowser )

OOP Syntax Help! I don't understand this!

Method: browser:getURL(...)
Variable: .url
Counterpart: loadBrowserURL


Required Arguments

  • webBrowser: The browser

Returns

Returns the web browser URL.

Example

local sX , sY = guiGetScreenSize()


local guiWindow = guiCreateWindow( 0, 0, sX, sY, "Youtube Application", false )
local guiBrowser= guiCreateBrowser( 0, 0, sX, sY, false, false, false, window )
local theBrowser = guiGetBrowser( browser )

addEventHandler( "onClientBrowserCreated", theBrowser, 
	function( )
		loadBrowserURL( source, "https://www.youtube.com/" )
		

		if getBrowserURL(theBrowser) == "" then
		outputChatBox("youtube isn't loaded yet.")
		end
	end
)

See Also