Skip to content

Commit 18ee2cc

Browse files
committed
Remove isBrowserSupported
1 parent 303f47f commit 18ee2cc

File tree

4 files changed

+4
-42
lines changed

4 files changed

+4
-42
lines changed

Client/core/CCore.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,8 +1150,7 @@ void CCore::DestroyNetwork ( )
11501150
void CCore::InitialiseWeb ()
11511151
{
11521152
// Don't initialise webcore twice
1153-
// Also disable webbrowser stuff if this PC still uses deprecated, vulnerable software e.g. XP
1154-
if ( m_pWebCore || !IsWindows7OrGreater() )
1153+
if ( m_pWebCore )
11551154
return;
11561155

11571156
// Ensure DllDirectory has not been changed

Client/core/CSettings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3188,7 +3188,7 @@ void CSettings::SaveData ( void )
31883188
CVARS_SET ( "streaming_memory", value );
31893189

31903190
// Webbrowser settings
3191-
bool bOldRemoteWebsites, bOldRemoteJavascript, bOldPlugins;
3191+
bool bOldRemoteWebsites, bOldRemoteJavascript;
31923192
CVARS_GET ( "browser_remote_websites", bOldRemoteWebsites );
31933193
CVARS_GET ( "browser_remote_javascript", bOldRemoteJavascript );
31943194

Client/mods/deathmatch/logic/luadefs/CLuaBrowserDefs.cpp

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
void CLuaBrowserDefs::LoadFunctions ( void )
1515
{
1616
// Define browser functions
17-
CLuaCFunctions::AddFunction( "isBrowserSupported", IsBrowserSupported );
18-
1917
std::map<const char*, lua_CFunction> functions
2018
{
2119
{ "createBrowser", CreateBrowser },
@@ -52,36 +50,10 @@ void CLuaBrowserDefs::LoadFunctions ( void )
5250
};
5351

5452
// Add browser functions
55-
if ( g_pCore->GetWebCore () )
53+
for ( const auto& pair : functions )
5654
{
57-
for ( const auto& pair : functions )
58-
{
59-
CLuaCFunctions::AddFunction ( pair.first, pair.second );
60-
}
61-
}
62-
else
63-
{
64-
for ( const auto& pair : functions )
65-
{
66-
CLuaCFunctions::AddFunction( pair.first, [](lua_State* luaVM) -> int {
67-
// Show message box eventually
68-
static bool messageBoxShown = false;
69-
if ( !messageBoxShown )
70-
{
71-
g_pCore->ShowMessageBox(_("Unsupported OS"),
72-
_("This server uses browser functions that are not supported on your PC. If you click OK, you are aware that your PC is vulnerable to malware and will most likely join a botnet soon"),
73-
MB_BUTTON_OK | MB_ICON_WARNING);
74-
75-
messageBoxShown = true;
76-
}
77-
78-
g_pCore->DebugPrintfColor ( "Called browser function on unsupported, vulnerable operating system. Please upgrade your OS as soon as possible", 255, 0, 0 );
79-
lua_pushboolean ( luaVM, false );
80-
return 1;
81-
} );
82-
}
55+
CLuaCFunctions::AddFunction ( pair.first, pair.second );
8356
}
84-
8557
}
8658

8759

@@ -90,7 +62,6 @@ void CLuaBrowserDefs::AddClass ( lua_State* luaVM )
9062
lua_newclass ( luaVM );
9163

9264
lua_classfunction ( luaVM, "create", "createBrowser" );
93-
lua_classfunction ( luaVM, "isSupported", "isBrowserSupported" );
9465
lua_classfunction ( luaVM, "loadURL", "loadBrowserURL" );
9566
lua_classfunction ( luaVM, "isLoading", "isBrowserLoading" );
9667
lua_classfunction ( luaVM, "injectMouseMove", "injectBrowserMouseMove" );
@@ -181,12 +152,6 @@ int CLuaBrowserDefs::CreateBrowser ( lua_State* luaVM )
181152
return 1;
182153
}
183154

184-
int CLuaBrowserDefs::IsBrowserSupported ( lua_State* luaVM )
185-
{
186-
lua_pushboolean ( luaVM, g_pCore->GetWebCore() != nullptr );
187-
return 1;
188-
}
189-
190155
int CLuaBrowserDefs::RequestBrowserDomains ( lua_State* luaVM )
191156
{
192157
// bool requestBrowserDomains ( table domains, bool isURL [, function callback ] )

Client/mods/deathmatch/logic/luadefs/CLuaBrowserDefs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class CLuaBrowserDefs : public CLuaDefs
1818
static void LoadFunctions ( void );
1919
static void AddClass ( lua_State* luaVM );
2020

21-
static bool IsBrowserSupported ();
22-
2321
LUA_DECLARE ( CreateBrowser );
2422
LUA_DECLARE ( IsBrowserSupported );
2523
LUA_DECLARE ( RequestBrowserDomains );

0 commit comments

Comments
 (0)