RequestBrowserDomains

From Multi Theft Auto: Wiki
Revision as of 17:48, 20 January 2019 by DieselTV (talk | contribs)
Jump to navigation Jump to search

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

[[{{{image}}}|link=|]] Note: Using loadBrowserURL without using requestBrowserDomains so the links may not work. -- made by Mohamed Hussein

Syntax

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

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(bool wasAccapted, table new_domains)

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