From 220483f00fa1a5986d8231d805056a279c05d5d4 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Mon, 18 Jul 2022 18:20:16 +0200 Subject: [PATCH] Fix using test mode --- src/components/appNavigationController.ts | 2 +- src/helpers/setWorkerProxy.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/appNavigationController.ts b/src/components/appNavigationController.ts index 35a74495..5fdf1132 100644 --- a/src/components/appNavigationController.ts +++ b/src/components/appNavigationController.ts @@ -237,7 +237,7 @@ export class AppNavigationController { public replaceState() { this.debug && this.log.warn('replace'); - const url = location.origin + location.pathname + this.overriddenHash; + const url = location.origin + location.pathname + location.search + this.overriddenHash; history.replaceState(this.id, '', url); } diff --git a/src/helpers/setWorkerProxy.ts b/src/helpers/setWorkerProxy.ts index 83ad857a..b8cef5a0 100644 --- a/src/helpers/setWorkerProxy.ts +++ b/src/helpers/setWorkerProxy.ts @@ -15,8 +15,13 @@ export default function setWorkerProxy() { } }; - const workerProxy = new Proxy(Worker, workerHandler); - Worker = workerProxy; + [ + Worker, + typeof(SharedWorker) !== 'undefined' && SharedWorker + ].forEach((w) => { + if(!w) return; + window[w.name as any] = new Proxy(w, workerHandler); + }); } setWorkerProxy();