mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 18:12:00 +00:00
Shared Ctx tab rename to SharedJSContext (#395)
This commit is contained in:
committed by
GitHub
parent
0dd0d9f4bd
commit
621bb0107e
+4
-2
@@ -394,8 +394,10 @@ async def get_tab_lambda(test) -> Tab:
|
|||||||
raise ValueError(f"Tab not found by lambda")
|
raise ValueError(f"Tab not found by lambda")
|
||||||
return tab
|
return tab
|
||||||
|
|
||||||
|
SHARED_CTX_NAMES = ["SharedJSContext", "Steam Shared Context presented by Valve™", "Steam", "SP"]
|
||||||
|
|
||||||
def tab_is_gamepadui(t: Tab) -> bool:
|
def tab_is_gamepadui(t: Tab) -> bool:
|
||||||
return "https://steamloopback.host/routes/" in t.url and (t.title == "Steam Shared Context presented by Valve™" or t.title == "Steam" or t.title == "SP")
|
return "https://steamloopback.host/routes/" in t.url and t.title in SHARED_CTX_NAMES
|
||||||
|
|
||||||
async def get_gamepadui_tab() -> Tab:
|
async def get_gamepadui_tab() -> Tab:
|
||||||
tabs = await get_tabs()
|
tabs = await get_tabs()
|
||||||
@@ -412,7 +414,7 @@ async def inject_to_tab(tab_name, js, run_async=False):
|
|||||||
async def close_old_tabs():
|
async def close_old_tabs():
|
||||||
tabs = await get_tabs()
|
tabs = await get_tabs()
|
||||||
for t in tabs:
|
for t in tabs:
|
||||||
if not t.title or (t.title != "Steam Shared Context presented by Valve™" and t.title != "Steam" and t.title != "SP"):
|
if not t.title or t.title not in SHARED_CTX_NAMES:
|
||||||
logger.debug("Closing tab: " + getattr(t, "title", "Untitled"))
|
logger.debug("Closing tab: " + getattr(t, "title", "Untitled"))
|
||||||
await t.close()
|
await t.close()
|
||||||
await sleep(0.5)
|
await sleep(0.5)
|
||||||
Reference in New Issue
Block a user