diff --git a/src/core/injector/event_handler.cpp b/src/core/injector/event_handler.cpp index c205902c..a4718520 100644 --- a/src/core/injector/event_handler.cpp +++ b/src/core/injector/event_handler.cpp @@ -423,7 +423,14 @@ class client : public std::enable_shared_from_this // if the hooked file is a css file, we want to add the colors structure. if (isCss) { - responseBody = base64_encode(std::format("{}\n\n/*\nTHE FOLLOWING WAS INJECTED BY MILLENNIUM\n*/\n\n{}\n\n/*\nBEGIN COLOR INSERTION\n*/\n{}\n/*\nEND COLORS\n*/\n/*\nEND INJECTION\n*/", base64_decode(m_socket_resp["result"]["body"]), g_fileResponse, colors == "[NoColors]" ? std::string() : colors)); + responseBody = base64_encode(std::format( + "{}\n\n/*\nTHE FOLLOWING WAS INJECTED BY MILLENNIUM\n*/" + "\n\n{}\n\n" + "/*\nBEGIN COLOR INSERTION\n*/" + "\n{}\n" + "/*\nEND COLORS\n*/\n" + "/*\nEND INJECTION\n*/", + base64_decode(m_socket_resp["result"]["body"]), g_fileResponse, colors == "[NoColors]" ? std::string() : colors)); } else { responseBody = base64_encode(std::format("{}\n\n/*\nTHE FOLLOWING WAS INJECTED BY MILLENNIUM\n*/\n\n{}\n\n/*\nEND INJECTION\n*/", base64_decode(m_socket_resp["result"]["body"]), g_fileResponse)); @@ -507,7 +514,6 @@ class client : public std::enable_shared_from_this } // parse if statement is array object or single - std::vector> statements; if (patch["Statement"].is_object()) @@ -587,8 +593,6 @@ class client : public std::enable_shared_from_this } } - - return returnVal.empty() ? std::vector{ {true} } : returnVal; } diff --git a/src/millennium.vcxproj b/src/millennium.vcxproj index 238d8bd4..804aad79 100644 --- a/src/millennium.vcxproj +++ b/src/millennium.vcxproj @@ -256,7 +256,6 @@ - @@ -291,7 +290,6 @@ - diff --git a/src/utils/config/config.cpp b/src/utils/config/config.cpp index 22cdb11e..2916c122 100644 --- a/src/utils/config/config.cpp +++ b/src/utils/config/config.cpp @@ -448,13 +448,22 @@ const nlohmann::json themeConfig::getThemeData(bool raw) noexcept } bool hasJavaScriptPatch = std::any_of(jsonBuffer["Patches"].begin(), jsonBuffer["Patches"].end(), - [](const nlohmann::json& patch) { - return patch.contains("TargetJs"); + [&](const nlohmann::json& patch) { + if (patch.contains("TargetJs")) { + + const std::string fileName = patch["TargetJs"].get(); + std::string filePath = std::format("{}/{}/{}", m_themesPath, ACTIVE_ITEM, fileName); + + if (std::filesystem::exists(filePath)) { + return true; + } + } + return false; }); - if (hasJavaScriptPatch && Settings::Get("allow-javascript") == false && !Settings::Get("prompted-js")) { + if (hasJavaScriptPatch && Settings::Get("allow-javascript") == false) { int result = MsgBox( - "The selected theme may be using JavaScript to enhance your Steam experience.\n" + "The selected theme is using JavaScript to enhance your Steam experience.\n" "You have JavaScript disabled in Millennium settings, therefore, the selected skin may not function properly.\n\n" "Enable JavaScript ONLY IF you trust the developer, have manually reviewed the code, or it's an official theme.\n\n" "Would you like to enable JavaScript execution?",