BrowserLoadingFailed: Difference between revisions
No edit summary |
No edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{ClientsideCsJsEvent}} | ||
This event is called everytime a CEF Browser loading fails. | |||
{{CSharpContainer| | |||
<pre> | |||
public delegate void OnBrowserLoadingFailedDelegate(HtmlWindow window); | |||
</pre> | |||
{{Parameters}} | |||
* '''window''': The created browser handler, output expects '''RAGE.Ui.HtmlWindow''' type. | |||
{{Example}} | |||
The example below shows a message to player when a browser fails to load. | |||
<syntaxhighlight lang="c#"> | |||
Events.OnBrowserLoadingFailed += OnBrowserLoadingFailed; | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="c#"> | |||
public void OnBrowserLoadingFailed(RAGE.Ui.HtmlWindow window) | |||
{ | |||
RAGE.Chat.Output($"The browser window {window.Url} failed to load"); | |||
} | |||
</syntaxhighlight> | |||
}} | |||
{{JSContainer| | |||
{{ | <syntaxhighlight lang="javascript"> | ||
mp.events.add('browserLoadingFailed', (browser) => {}); | mp.events.add('browserLoadingFailed', (browser) => {}); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Parameters}} | |||
* '''browser''': The browser handler, output expects | * '''browser''': The browser handler, output expects '''any''' type. | ||
{{Example}} | |||
The example below shows up a message for a player when a CEF Browser loading fails. | The example below shows up a message for a player when a CEF Browser loading fails. | ||
| Line 20: | Line 40: | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | |||
==See more== | |||
{{Browser_definition_c}} | |||
[[Category:Client-side Event]] | |||
Latest revision as of 03:34, 28 May 2024
Client-Side Event
This event is called everytime a CEF Browser loading fails.
C# Syntax
public delegate void OnBrowserLoadingFailedDelegate(HtmlWindow window);
Parameters
- window: The created browser handler, output expects RAGE.Ui.HtmlWindow type.
Example
The example below shows a message to player when a browser fails to load.
Events.OnBrowserLoadingFailed += OnBrowserLoadingFailed;
public void OnBrowserLoadingFailed(RAGE.Ui.HtmlWindow window)
{
RAGE.Chat.Output($"The browser window {window.Url} failed to load");
}
JavaScript Syntax
mp.events.add('browserLoadingFailed', (browser) => {});
Parameters
- browser: The browser handler, output expects any type.
Example
The example below shows up a message for a player when a CEF Browser loading fails.
mp.events.add('browserLoadingFailed', (browser) => {
mp.gui.chat.push('Oh boy, your browser failed to load :/');
});
See more
- Functions:
- Properies: