OnClientBrowserWhitelistChange: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client event}}
{{Client event}}
{{Needs Example}}
{{New feature/item|3.0150|1.5||
{{New feature/item|3.0150|1.5||
The event is triggered when the whitelist has changed. Note that this event is only triggered if the request window was confirmed by accepting.
The event is triggered when the whitelist has changed. Note that this event is only triggered if the request window was confirmed by accepting.
}}
}}
{{Note|Attaching the event to a webbrowser won't work. Attach it to the root element instead.}}


==Parameters==  
==Parameters==  
Line 10: Line 10:
table changedDomains
table changedDomains
</syntaxhighlight>
</syntaxhighlight>
*'''changedDomains:''' A list of changed domains
*'''changedDomains:''' a [[table]] of changed domains.


==Source==
==Source==
The [[Element/Browser|browser]] element
The [[Element_tree#Tree_elements|root]] element.


==Example==  
==Example==  
TODO
<syntaxhighlight lang="lua">
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>


[[pl:onClientBrowserWhitelistChange]]
[[pl:onClientBrowserWhitelistChange]]

Latest revision as of 19:24, 19 September 2018

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

[[{{{image}}}|link=|]] Note: Attaching the event to a webbrowser won't work. Attach it to the root element instead.

Parameters

table changedDomains
  • changedDomains: a table of changed domains.

Source

The root 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