-
-
Notifications
You must be signed in to change notification settings - Fork 101
Description
The actvate command currently uses an id argument to activate a specific tab chrome-cli activate -t <id>, but if the tab_id provided is not in the frontmost window of Chrome, the command silently fails, even if a tab with that id exists in another window.
Since the list tabs command returns a list of ids that either:
- Contain colons:
[<window_id>:<tab_id>] <Tab_Name>if there is more than one window open, or - Do not contain colons:
[<tab_id>] <Tab_Name>if there is only one window open,
the simplest modification to improve/fix this would be to parse the id argument based on whether it contains a colon, and then:
-
If the id argument contains a colon, activate the tab_id following the colon of the window_id preceding the colon, if a tab with that tab_id exists in a window with that window_id.
chrome-cli activate -t <window_id>:<tab_id> -
If no colon is found, then activate the tab_id in the frontmost window, if a tab with that id exists in that window.
chrome-cli activate -t <tab_id>