- Documentation
- Client functions
- requestBrowserDomains
Function
requestBrowserDomains
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 = falsetruewhen 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)
"browser_domains": ["youtube.com"]