GetBrowserTitle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Jusonex moved page Cef/getBrowserTitle to GetBrowserTitle)
(→‎Example: added example)
Line 19: Line 19:
==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--todo
addCommandHandler("browsers",
function()
outputChatBox("List of browser titles:")
for k, v in pairs( getElementByType("web-browser") ) do
outputChatBox(k .. ". " .. getBrowserTitle(v))
end
end
)
</syntaxhighlight>
</syntaxhighlight>


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

Revision as of 06:40, 7 July 2015

This function returns the title of the passed browser.

Syntax

string getBrowserTitle ( browser webBrowser )

OOP Syntax Help! I don't understand this!

Method: browser:getTitle(...)
Counterpart: getBrowserTitle


Required arguments

  • webBrowser: The browser

Returns

Returns the title as a string. Returns false if invalid arguments were passed.

Example

addCommandHandler("browsers",
	function()
		outputChatBox("List of browser titles:")
		for k, v in pairs( getElementByType("web-browser") ) do
			outputChatBox(k .. ". " .. getBrowserTitle(v))
		end
	end
)

See Also