1
0
mirror of synced 2024-12-01 02:37:18 +01:00

fix: Reloading ImHex not working in the web version

This commit is contained in:
WerWolv 2023-10-04 21:45:43 +02:00
parent eb41622a38
commit 1c88c3a8bd
2 changed files with 7 additions and 14 deletions

View File

@ -113,6 +113,7 @@ namespace {
#if defined(OS_WEB) #if defined(OS_WEB)
using namespace hex::init; using namespace hex::init;
void saveFsData() { void saveFsData() {
@ -137,6 +138,12 @@ namespace {
splashWindow->startStartupTasks(); splashWindow->startStartupTasks();
EventManager::subscribe<RequestRestartImHex>([&] {
MAIN_THREAD_EM_ASM({
location.reload();
});
});
// Draw the splash window while tasks are running // Draw the splash window while tasks are running
emscripten_set_main_loop_arg([](void *arg) { emscripten_set_main_loop_arg([](void *arg) {
auto splashWindow = reinterpret_cast<WindowSplash*>(arg); auto splashWindow = reinterpret_cast<WindowSplash*>(arg);

View File

@ -1,14 +0,0 @@
import http.server
import os
class MyHttpRequestHandler(http.server.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header("Cross-Origin-Embedder-Policy", "require-corp")
self.send_header("Cross-Origin-Opener-Policy", "same-origin")
http.server.SimpleHTTPRequestHandler.end_headers(self)
if __name__ == '__main__':
os.chdir(".")
httpd = http.server.HTTPServer(("", 9090), MyHttpRequestHandler)
httpd.serve_forever()