RequestBrowserDomains: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 6: Line 6:


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool requestBrowserDomains ( table pages )</syntaxhighlight>
<syntaxhighlight lang="lua">bool requestBrowserDomains ( table pages [, bool parseAsURL = false] )</syntaxhighlight>
{{OOP||[[Element/Browser|browser]].requestDomains||requestBrowserDomains}}
{{OOP||[[Element/Browser|browser]].requestDomains||requestBrowserDomains}}


===Required arguments===
===Required Arguments===
*'''pages:''' A table containing all domains ('''without''' <font color='red'><nowiki>http://</nowiki></font>)
*'''pages:''' A table containing all domains ('''without''' <font color='red'><nowiki>http://</nowiki></font>)
===Optional Arguments===
*'''parseAsURL:''' ''true'' if the passed addresses should be converted from URLs, ''false'' otherwise.


===Returns===
===Returns===

Revision as of 12:55, 4 May 2015

This function opens a request window in order to accept the requested remote URLs.

Syntax

bool requestBrowserDomains ( table pages [, bool parseAsURL = false] )

OOP Syntax Help! I don't understand this!

Method: browser.requestDomains(...)
Counterpart: requestBrowserDomains


Required Arguments

  • pages: A table containing all domains (without http://)

Optional Arguments

  • parseAsURL: true if the passed addresses should be converted from URLs, false otherwise.

Returns

Returns true, if the string was successfully read, false otherwise.

Example

requestBrowserDomains({ "mtasa.com" }) -- request browser domain
showCursor(true) -- show cursor
addEventHandler("onClientBrowserWhitelistChange", root,
	function(newDomains)
		if newDomains[1] == "mtasa.com" then
			local browser = createBrowser(1280, 720, false, false) -- create browser
			loadBrowserURL(browser, "http://mtasa.com/") -- load browser url
		end
	end
)

See also