Skip to content

Commit eb82048

Browse files
refactor: migrate to breeze-js
1 parent 2c45cec commit eb82048

31 files changed

Lines changed: 203 additions & 76719 deletions

deps/breeze-js.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local BREEZE_JS_VERSION = "2026.03.30+4"
22
local BREEZE_JS_HASH = "6483f9d678b230aed508ea5eb66d4306c03dfe15"
3-
local BREEZE_JS_SOURCEDIR = path.join(os.scriptdir(), "../", "../GitHub/breeze-js")
3+
local BREEZE_JS_SOURCEDIR = path.join(os.scriptdir(), "../", "../breeze-js")
44
local USE_LOCAL = os.exists(BREEZE_JS_SOURCEDIR)
55

66
if USE_LOCAL then

src/shell/contextmenu/hooks.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "nanovg.h"
66
#include "shell/config.h"
77
#include "shell/entry.h"
8-
#include "shell/script/quickjspp.hpp"
8+
#include "breeze-js/quickjspp.hpp"
99

1010
#include "blook/blook.h"
1111
#include <atlcomcli.h>
@@ -392,4 +392,4 @@ HRESULT GetUIObjectOf(
392392
return res;
393393
});
394394
spdlog::info( "GetUIObjectOf hook installed");
395-
}
395+
}

src/shell/entry.cc

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "error_handler.h"
1010
#include "res_string_loader.h"
1111
#include "script/binding_types.hpp"
12-
#include "script/quickjspp.hpp"
12+
#include "breeze-js/quickjspp.hpp"
1313
#include "script/script.h"
1414
#include "utils.h"
1515

@@ -48,8 +48,6 @@
4848

4949
#include <Windows.h>
5050

51-
#include "qjs_sanitizer.h"
52-
5351
#include "logger.h"
5452

5553
namespace mb_shell {
@@ -140,8 +138,18 @@ void main() {
140138
if (filename == "explorer.exe" || filename == "360filebrowser64.exe" || filename == "desktopmgr64.exe") {
141139
init_render_global();
142140
res_string_loader::init();
143-
context_menu_hooks::install_NtUserTrackPopupMenuEx_hook();
144-
fix_win11_menu::install();
141+
// context_menu_hooks::install_NtUserTrackPopupMenuEx_hook();
142+
// fix_win11_menu::install();
143+
std::thread([]() {
144+
script_ctx.is_js_ready.wait(false);
145+
spdlog::info("Is js ready: %d", script_ctx.is_js_ready.load());
146+
if (auto res =
147+
script_ctx.eval_string("globalThis.showConfigPage()",
148+
"asan.js");
149+
!res) {
150+
spdlog::error("Failed to show config page: {}", res.error());
151+
}
152+
}).detach();
145153
}
146154

147155
if (filename == "onecommander.exe") {
@@ -199,10 +207,13 @@ void main() {
199207
init_console(true);
200208
std::thread([]() {
201209
script_ctx.is_js_ready.wait(false);
202-
spdlog::info( "Is js ready: %d", script_ctx.is_js_ready.load());
203-
script_ctx.js->enqueueJob([]() {
204-
script_ctx.js->eval("globalThis.showConfigPage()", "asan.js");
205-
});
210+
spdlog::info("Is js ready: %d", script_ctx.is_js_ready.load());
211+
if (auto res =
212+
script_ctx.eval_string("globalThis.showConfigPage()",
213+
"asan.js");
214+
!res) {
215+
spdlog::error("Failed to show config page: {}", res.error());
216+
}
206217
}).detach();
207218
}
208219
}
@@ -225,4 +236,4 @@ extern "C" __declspec(dllexport) void func() {
225236
// running without blocking the main thread.
226237
std::this_thread::sleep_for(std::chrono::milliseconds(100));
227238
}
228-
}
239+
}

src/shell/qjs_sanitizer.cc

Lines changed: 0 additions & 198 deletions
This file was deleted.

src/shell/qjs_sanitizer.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)