IsBrowserDomainBlocked: Difference between revisions
Jump to navigation
Jump to search
m (Danny To moved page Cef/isBrowserURLBlocked to Cef/isBrowserDomainBlocked: Function has been renamed.) |
m (Link to the Romanian translation of this page added.) |
||
(13 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Client function}} | ||
{{New feature/item|3.0150|1.5|| | |||
This function checks if the specified URL is blocked from being loaded. | This function checks if the specified URL is blocked from being loaded. | ||
}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool | bool isBrowserDomainBlocked ( string address [, bool isURL = false] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP|This is a static function under the '''Browser''' class|[[Element/Browser|Browser]].isDomainBlocked}} | |||
===Required arguments=== | ===Required arguments=== | ||
*''' | *'''address:''' A website URL | ||
===Optional arguments=== | |||
*'''isURL:''' ''true'' if ''address'' should be parsed as URL, ''false'' otherwise. | |||
===Returns=== | ===Returns=== | ||
Returns '' | Returns ''false'' if the URL is able to be loaded, ''true'' if it is blocked and ''nil'' if an invalid domain/URL was passed. | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | |||
--Check the state of wiki.mtasa.com | |||
if ( isBrowserDomainBlocked ( "wiki.mtasa.com" ) ) then | |||
--If it is blocked. | |||
outputChatBox("wiki.mtasa.com is blocked and can't be loaded right now!") | |||
else | |||
--If it is not blocked. (Was accepted by the user) | |||
outputChatBox("wiki.mtasa.com is not blocked and ready to be loaded!") | |||
end | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{CEF_functions}} | {{CEF_functions}} | ||
[[hu:isBrowserDomainBlocked]] | |||
[[RO:isBrowserDomainBlocked]] |
Latest revision as of 12:36, 8 April 2020
This function checks if the specified URL is blocked from being loaded.
Syntax
bool isBrowserDomainBlocked ( string address [, bool isURL = false] )
OOP Syntax Help! I don't understand this!
- Note: This is a static function under the Browser class
- Method: Browser.isDomainBlocked(...)
Required arguments
- address: A website URL
Optional arguments
- isURL: true if address should be parsed as URL, false otherwise.
Returns
Returns false if the URL is able to be loaded, true if it is blocked and nil if an invalid domain/URL was passed.
Example
--Check the state of wiki.mtasa.com if ( isBrowserDomainBlocked ( "wiki.mtasa.com" ) ) then --If it is blocked. outputChatBox("wiki.mtasa.com is blocked and can't be loaded right now!") else --If it is not blocked. (Was accepted by the user) outputChatBox("wiki.mtasa.com is not blocked and ready to be loaded!") end
See Also
- canBrowserNavigateBack
- canBrowserNavigateForward
- createBrowser
- executeBrowserJavascript
- focusBrowser
- getBrowserProperty
- getBrowserSettings
- getBrowserSource
- getBrowserTitle
- getBrowserURL
- injectBrowserMouseDown
- injectBrowserMouseMove
- injectBrowserMouseUp
- injectBrowserMouseWheel
- isBrowserDomainBlocked
- isBrowserFocused
- isBrowserLoading
- isBrowserRenderingPaused
- loadBrowserURL
- navigateBrowserBack
- navigateBrowserForward
- reloadBrowserPage
- requestBrowserDomains
- resizeBrowser
- setBrowserAjaxHandler
- setBrowserProperty
- setBrowserRenderingPaused
- setBrowserVolume
- toggleBrowserDevTools