diff options
| author | AAGaming <aa@mail.catvibers.me> | 2023-06-07 18:03:41 -0400 |
|---|---|---|
| committer | AAGaming <aa@mail.catvibers.me> | 2023-06-07 18:03:41 -0400 |
| commit | 9a05c228a004392df6921a7706f4ae6a62fff2d3 (patch) | |
| tree | c175788ffc6917a66db810eb14073c57b750efb3 /backend | |
| parent | 00d9b03322773b4e43f125b1c0467334e5a7a08c (diff) | |
| download | decky-loader-9a05c228a004392df6921a7706f4ae6a62fff2d3.tar.gz decky-loader-9a05c228a004392df6921a7706f4ae6a62fff2d3.zip | |
fix dumb crash when updating decky while a plugin that uses BrowserView is running
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/injector.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/injector.py b/backend/injector.py index b28a0349..e3414fee 100644 --- a/backend/injector.py +++ b/backend/injector.py @@ -395,6 +395,7 @@ async def get_tab_lambda(test) -> Tab: return tab SHARED_CTX_NAMES = ["SharedJSContext", "Steam Shared Context presented by Valveā¢", "Steam", "SP"] +CLOSEABLE_URLS = ["about:blank", "data:text/html,%3Cbody%3E%3C%2Fbody%3E"] # Closing anything other than these *really* likes to crash Steam DO_NOT_CLOSE_URL = "Valve Steam Gamepad/default" # Steam Big Picture Mode tab def tab_is_gamepadui(t: Tab) -> bool: @@ -415,7 +416,7 @@ async def inject_to_tab(tab_name, js, run_async=False): async def close_old_tabs(): tabs = await get_tabs() for t in tabs: - if not t.title or (t.title not in SHARED_CTX_NAMES and DO_NOT_CLOSE_URL not in t.url): + if not t.title or (t.title not in SHARED_CTX_NAMES and any(url in t.url for url in CLOSEABLE_URLS) and DO_NOT_CLOSE_URL not in t.url): logger.debug("Closing tab: " + getattr(t, "title", "Untitled")) await t.close() await sleep(0.5) |
