BrowserLoadingFailed

From RAGE Multiplayer Wiki
Revision as of 03:34, 28 May 2024 by Shr0x (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-Side Event

 C#  JavaScript


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