RequestBrowserDomains: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 14: Line 14:
===Optional Arguments===
===Optional Arguments===
*'''parseAsURL:''' ''true'' if the passed addresses should be converted from URLs, ''false'' otherwise.
*'''parseAsURL:''' ''true'' if the passed addresses should be converted from URLs, ''false'' otherwise.
*'''callback:''' A callback function that is called as soon as the result is available
Syntax:
<syntaxhighlight lang="lua">function(wasAccapted, new_domains)</syntaxhighlight>


===Returns===
===Returns===
Line 19: Line 22:


==Example==
==Example==
{{Needs_Example}}
<syntaxhighlight lang="lua">requestBrowserDomains({ "mtasa.com" }) -- request browser domain
<syntaxhighlight lang="lua">requestBrowserDomains({ "mtasa.com" }) -- request browser domain
showCursor(true) -- show cursor
showCursor(true) -- show cursor

Revision as of 15:30, 20 November 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(...)


Required Arguments

  • pages: A table containing all domains

Optional Arguments

  • parseAsURL: true if the passed addresses should be converted from URLs, false otherwise.
  • callback: A callback function that is called as soon as the result is available

Syntax:

function(wasAccapted, new_domains)

Returns

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

Example

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

Before submitting check out Editing Guidelines Script Examples.
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