OnClientBrowserWhitelistChange: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 17: Line 17:
==Example==  
==Example==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
TODO
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
)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 16:55, 23 May 2018

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

Before submitting check out Editing Guidelines Script Examples.

The event is triggered when the whitelist has changed. Note that this event is only triggered if the request window was confirmed by accepting.

Parameters

table changedDomains
  • changedDomains: a table of changed domains.

Source

The browser element.

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