target first remote browser when not giving it with a alias and update version to 0.8.4
This commit is contained in:
+12
-1
@@ -127,10 +127,21 @@ def remote_target_for_alias(alias: str | None) -> BrowserTarget | None:
|
||||
"""Resolve a user-facing remote alias such as 'host:profile' to a target."""
|
||||
if not alias:
|
||||
return None
|
||||
for target in _remote_browser_targets():
|
||||
targets = _remote_browser_targets()
|
||||
for target in targets:
|
||||
endpoint_profile = f"{target.remote}:{target.profile}" if target.remote else None
|
||||
if alias in {target.display_name, endpoint_profile}:
|
||||
return target
|
||||
|
||||
endpoint_matches = []
|
||||
for target in targets:
|
||||
if not target.remote:
|
||||
continue
|
||||
remote_host, sep, _remote_port = target.remote.rpartition(":")
|
||||
if alias == target.remote or (sep and alias == remote_host):
|
||||
endpoint_matches.append(target)
|
||||
if len(endpoint_matches) == 1:
|
||||
return endpoint_matches[0]
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user