GetBrowserURL: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 20: Line 20:
==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--todo
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
)
 
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{CEF_functions}}
{{CEF_functions}}

Revision as of 17:34, 30 July 2017

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