diff --git a/backend/main.py b/backend/main.py index b2e3e74a7..ef1dafc4d 100644 --- a/backend/main.py +++ b/backend/main.py @@ -24,8 +24,9 @@ # local modules from browser import PluginBrowser from helpers import (REMOTE_DEBUGGER_UNIT, csrf_middleware, get_csrf_token, - mkdir_as_user, get_system_pythonpaths, get_effective_user_id) - + mkdir_as_user, get_system_pythonpaths, get_effective_user_id, + get_loader_version) + from injector import get_gamepadui_tab, Tab, get_tabs, close_old_tabs from loader import Loader from settings import SettingsManager @@ -162,7 +163,7 @@ async def inject_javascript(self, tab: Tab, first=False, request=None): if first: if await tab.has_global_var("deckyHasLoaded", False): await close_old_tabs() - await tab.evaluate_js("try{if (window.deckyHasLoaded){setTimeout(() => location.reload(), 100)}else{window.deckyHasLoaded = true;(async()=>{try{while(!window.SP_REACT){await new Promise(r => setTimeout(r, 10))};await import('http://localhost:1337/frontend/index.js')}catch(e){console.error(e)};})();}}catch(e){console.error(e)}", False, False, False) + await tab.evaluate_js("try{if (window.deckyHasLoaded){setTimeout(() => location.reload(), 100)}else{window.deckyHasLoaded = true;(async()=>{try{while(!window.SP_REACT){await new Promise(r => setTimeout(r, 10))};await import('http://localhost:1337/frontend/index.js?v=%s')}catch(e){console.error(e)};})();}}catch(e){console.error(e)}" % (get_loader_version(), ), False, False, False) except: logger.info("Failed to inject JavaScript into tab\n" + format_exc()) pass