mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Re-organize initialization so that User-Agent CVar actually works. Add web.headless CVar to not load CEF even on graphical client. Clean up init logic to not rely on static IoC, and clean up loggers used too.
30 lines
999 B
C#
30 lines
999 B
C#
using Robust.Shared.Configuration;
|
|
|
|
namespace Robust.Client.WebView;
|
|
|
|
// ReSharper disable once InconsistentNaming
|
|
/// <summary>
|
|
/// CVars for <c>Robust.Client.WebView</c>
|
|
/// </summary>
|
|
[CVarDefs]
|
|
public static class WCVars
|
|
{
|
|
/// <summary>
|
|
/// Enable the <c>res://</c> protocol inside WebView browsers, allowing access to the Robust resources.
|
|
/// </summary>
|
|
public static readonly CVarDef<bool> WebResProtocol =
|
|
CVarDef.Create("web.res_protocol", true, CVar.CLIENTONLY);
|
|
|
|
/// <summary>
|
|
/// Overrides the default CEF user-agent when set to a non-empty string.
|
|
/// </summary>
|
|
public static readonly CVarDef<string> WebUserAgentOverride =
|
|
CVarDef.Create("web.user_agent", "", CVar.CLIENTONLY);
|
|
|
|
/// <summary>
|
|
/// If true, use headless WebView implementation even with graphical client (turn off CEF).
|
|
/// </summary>
|
|
public static readonly CVarDef<bool> WebHeadless =
|
|
CVarDef.Create("web.headless", false, CVar.CLIENTONLY);
|
|
}
|