ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. requestBrowserDomains

Function

requestBrowserDomains

ClientBrowserIdentical to MTA:SA

Asks the player for permission to open pages from the given domains. A domain must be on the server's list (browser_domains in server-config.json); others are rejected without asking. Consent is remembered.

Syntax

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

Arguments

pagestable
A list of domains or addresses.
parseAsURLbool, optional = false
true when the list contains full addresses.
callbackfunction, optional = nil
A function(accepted, newDomains) callback.

Returns

true if the request was sent.

Example

requestBrowserDomains({ "youtube.com" }, false, function(accepted)
    if accepted then
        loadBrowserURL(webBrowser, "https://youtube.com/embed/dQw4w9WgXcQ")
    end
end)

See also