diff options
| author | AAGaming <aagaming@riseup.net> | 2024-08-05 14:07:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-05 14:07:10 -0400 |
| commit | 131f0961ff451ec47376483178e092c8d7403b27 (patch) | |
| tree | 4d2ea34e8220e14c4b820cc1ad38face7193f6fe /backend/decky_loader | |
| parent | 75aa1e4851445646994ba3a61ff41325403359fb (diff) | |
| download | decky-loader-131f0961ff451ec47376483178e092c8d7403b27.tar.gz decky-loader-131f0961ff451ec47376483178e092c8d7403b27.zip | |
Rewrite router/tabs/toaster hooks (#661)
Diffstat (limited to 'backend/decky_loader')
| -rw-r--r-- | backend/decky_loader/injector.py | 2 | ||||
| -rw-r--r-- | backend/decky_loader/main.py | 1 | ||||
| -rw-r--r-- | backend/decky_loader/utilities.py | 4 |
3 files changed, 4 insertions, 3 deletions
diff --git a/backend/decky_loader/injector.py b/backend/decky_loader/injector.py index 26b0fc01..7d1a40c1 100644 --- a/backend/decky_loader/injector.py +++ b/backend/decky_loader/injector.py @@ -415,7 +415,7 @@ CLOSEABLE_URLS = ["about:blank", "data:text/html,%3Cbody%3E%3C%2Fbody%3E"] # Clo DO_NOT_CLOSE_URLS = ["Valve Steam Gamepad/default", "Valve%20Steam%20Gamepad"] # Steam Big Picture Mode tab def tab_is_gamepadui(t: Tab) -> bool: - return "https://steamloopback.host/routes/" in t.url and t.title in SHARED_CTX_NAMES + return ("https://steamloopback.host/routes/" in t.url or "https://steamloopback.host/index.html" in t.url) and t.title in SHARED_CTX_NAMES async def get_gamepadui_tab() -> Tab: tabs = await get_tabs() diff --git a/backend/decky_loader/main.py b/backend/decky_loader/main.py index 973919f1..5033126e 100644 --- a/backend/decky_loader/main.py +++ b/backend/decky_loader/main.py @@ -209,6 +209,7 @@ class PluginManager: await tab.close_websocket() self.js_ctx_tab = None await restart_webhelper() + await sleep(1) # To give CEF enough time to close down the websocket 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{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: diff --git a/backend/decky_loader/utilities.py b/backend/decky_loader/utilities.py index a90244a1..4850cdef 100644 --- a/backend/decky_loader/utilities.py +++ b/backend/decky_loader/utilities.py @@ -197,9 +197,9 @@ class Utilities: self.logger.debug(f"Finished stream for {url}") return res - async def http_request_legacy(self, method: str, url: str, extra_opts: Any = {}): + async def http_request_legacy(self, method: str, url: str, extra_opts: Any = {}, timeout: int | None = None): async with ClientSession() as web: - res = await web.request(method, url, ssl=helpers.get_ssl_context(), **extra_opts) + res = await web.request(method, url, ssl=helpers.get_ssl_context(), timeout=timeout, **extra_opts) text = await res.text() return { "status": res.status, |
