fix: Reloading ImHex not working in the web version
This commit is contained in:
parent
eb41622a38
commit
1c88c3a8bd
@ -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);
|
||||||
|
@ -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()
|
|
Loading…
Reference in New Issue
Block a user