allow to ask for remote host profiles and save token on first connection for later use
This commit is contained in:
@@ -16,8 +16,10 @@ def _handle(command, args=None, profile=None):
|
||||
raise SystemExit(1)
|
||||
|
||||
|
||||
def _handle_multi(command, args=None, profile=None):
|
||||
def _handle_multi(command, args=None, profile=None, remote=None, token=None):
|
||||
try:
|
||||
if remote:
|
||||
return send_command(command, args or {}, profile=profile, remote=remote, token=token)
|
||||
return send_command(command, args or {}, profile=profile)
|
||||
except (BrowserNotConnected, RuntimeError):
|
||||
return None
|
||||
@@ -28,7 +30,7 @@ def _multi_browser_targets():
|
||||
if root.obj.get("browser_explicit"):
|
||||
return []
|
||||
targets = active_browser_targets()
|
||||
if len(targets) <= 1:
|
||||
if len(targets) <= 1 and not any(target.remote for target in targets):
|
||||
return []
|
||||
return targets
|
||||
|
||||
@@ -92,7 +94,7 @@ def session_list():
|
||||
if targets:
|
||||
sessions = []
|
||||
for target in targets:
|
||||
result = _handle_multi("session.list", profile=target.profile)
|
||||
result = _handle_multi("session.list", profile=target.profile, remote=target.remote, token=target.token)
|
||||
if result is None:
|
||||
continue
|
||||
sessions.extend({**session, "browser": target.display_name} for session in result)
|
||||
|
||||
Reference in New Issue
Block a user