mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 08:47:49 +00:00
move webpack check into index
This commit is contained in:
@@ -159,7 +159,7 @@ class PluginManager:
|
|||||||
if ON_LINUX and await tab.has_global_var("deckyHasLoaded", False):
|
if ON_LINUX and await tab.has_global_var("deckyHasLoaded", False):
|
||||||
await restart_webhelper()
|
await restart_webhelper()
|
||||||
return # We'll catch the next tab in the main loop
|
return # We'll catch the next tab in the main loop
|
||||||
await tab.evaluate_js("try{if (window.deckyHasLoaded){setTimeout(() => SteamClient.Browser.RestartJSContext(), 100)}else{window.deckyHasLoaded = true;(async()=>{try{while(!window.webpackChunksteamui){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)
|
await tab.evaluate_js("try{if (window.deckyHasLoaded){setTimeout(() => SteamClient.Browser.RestartJSContext(), 100)}else{window.deckyHasLoaded = true;(async()=>{try{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:
|
except:
|
||||||
logger.info("Failed to inject JavaScript into tab\n" + format_exc())
|
logger.info("Failed to inject JavaScript into tab\n" + format_exc())
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ interface Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
// Wait for react to definitely be loaded
|
||||||
|
while (!window.webpackChunksteamui || window.webpackChunksteamui <= 3) {
|
||||||
|
await new Promise(r => setTimeout(r, 10)); // Can't use DFL sleep here.
|
||||||
|
}
|
||||||
|
|
||||||
if (!window.SP_REACT) {
|
if (!window.SP_REACT) {
|
||||||
console.debug('[Decky:Boot] Setting up React globals...');
|
console.debug('[Decky:Boot] Setting up React globals...');
|
||||||
// deliberate partial import
|
// deliberate partial import
|
||||||
|
|||||||
Reference in New Issue
Block a user