Browser::active: Difference between revisions
(Created page with "'''Function''': Gets or sets if the browser is active ==Parameters== * '''Toggle''': {{RageType|Boolean}} ==Syntax== {{ClientsideCode| <pre> browser.active; </pre> }} ==Exa...") |
No edit summary |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{ClientsideJsFunction}} | |||
{{JSContainer| | |||
== | '''Change or get browser active state. Active state is true by default when creating a browser, setting a browser's active property to false will hide it, and true will show it.''' | ||
* ''' | |||
===Params=== | |||
* '''enable''': {{RageType|boolean}} | |||
===Return value=== | |||
*''' {{RageType|boolean}} ''' | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="javascript"> | |||
< | browser.active; //getter | ||
browser.active; | browser.active = value; //setter | ||
</ | </syntaxhighlight> | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="javascript"> | |||
const mybrowser = mp.browsers.new('http://package/page/index.html'); | |||
< | mp.events.add('client::browser:changeState', (state) => { | ||
mybrowser.active = state; | |||
browser.active = | mp.console.logInfo(`You have ${state ? "enabled" : "disabled"} browser id ${mybrowser.id}`) | ||
</ | }) | ||
</syntaxhighlight> | |||
}} | }} | ||
==See also== | |||
==See | |||
{{Browser_definition_c}} | {{Browser_definition_c}} | ||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
[[Category:TODO: Example]] | |||
Latest revision as of 17:28, 2 July 2024
Client-Side Function
JavaScript Syntax
Change or get browser active state. Active state is true by default when creating a browser, setting a browser's active property to false will hide it, and true will show it.
Params
- enable: boolean
Return value
- boolean
Syntax
browser.active; //getter
browser.active = value; //setter
Example
const mybrowser = mp.browsers.new('http://package/page/index.html');
mp.events.add('client::browser:changeState', (state) => {
mybrowser.active = state;
mp.console.logInfo(`You have ${state ? "enabled" : "disabled"} browser id ${mybrowser.id}`)
})
See also
- Functions:
- Properies: