Skip to content

Commit

Permalink
chore(CI): Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
shdwmtr committed Dec 2, 2024
1 parent 54edc4c commit 31550a7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ jobs:
# Disable Millennium CLI for now, as it keeps get false positive detections for no apparent reason
# cp /d/a/Millennium/Millennium/build/cli/millennium.exe D:/a/env/ext/bin/millennium.exe
npm install @steambrew/api
cp -r ./node_modules/@steambrew/api/dist/webkit_api.js D:/a/env/ext/data/shims/webkit_api.js
cp -r ./node_modules/@steambrew/api/dist/client_api.js D:/a/env/ext/data/shims/client_api.js
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -271,6 +275,10 @@ jobs:
mkdir -p /home/runner/env/ext/bin
cp ./build/cli/millennium /home/runner/env/ext/bin/millennium
npm install @steambrew/api
cp -r ./node_modules/@steambrew/api/dist/webkit_api.js /home/runner/env/ext/data/shims/webkit_api.js
cp -r ./node_modules/@steambrew/api/dist/client_api.js /home/runner/env/ext/data/shims/client_api.js
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
Expand Down
10 changes: 9 additions & 1 deletion src/core/co_initialize/co_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
const std::string GetBootstrapModule(const std::vector<std::string> scriptModules, const uint16_t port)
{
std::string scriptModuleArray;
std::string scriptContents = SystemIO::ReadFileSync("C:\\Users\\Desktop-PC\\Documents\\Development\\plugutil\\api\\dist\\client_api.js");
std::string scriptContents = SystemIO::ReadFileSync((SystemIO::GetSteamPath() / "ext" / "data" / "shims" / "client_api.js").string());

if (scriptContents.empty())
{
LOG_ERROR("Missing webkit preload module. Please re-install Millennium.");
#ifdef _WIN32
MessageBoxA(NULL, "Missing client preload module. Please re-install Millennium.", "Millennium", MB_ICONERROR);
#endif
}

for (int i = 0; i < scriptModules.size(); i++)
{
Expand Down
11 changes: 10 additions & 1 deletion src/core/hooks/web_load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,16 @@ static const std::vector<std::string> g_blackListedUrls = {
const std::string WebkitHandler::PatchDocumentContents(std::string requestUrl, std::string original)
{
std::string patched = original;
const std::string webkitPreloadModule = SystemIO::ReadFileSync("C:\\Users\\Desktop-PC\\Documents\\Development\\plugutil\\api\\dist\\webkit_api.js");
const std::string webkitPreloadModule = SystemIO::ReadFileSync((SystemIO::GetSteamPath() / "ext" / "data" / "shims" / "webkit_api.js").string());

if (webkitPreloadModule.empty())
{
LOG_ERROR("Missing webkit preload module. Please re-install Millennium.");
#ifdef _WIN32
MessageBoxA(NULL, "Missing webkit preload module. Please re-install Millennium.", "Millennium", MB_ICONERROR);
#endif
return patched;
}

std::vector<std::string> scriptModules;
std::string cssShimContent;
Expand Down

0 comments on commit 31550a7

Please sign in to comment.