Better just call chrome.windows.update with {'focused': true} if --focused is set.
Dont know why, but at least in windows, now put the focus in a "random" window even with --focused not set.
Regards
Edit : I think that the problem is that if you set the focused to false it returns the focus to the last focused window. So better to not send a focused false.
(optional) focused : If true, brings the window to the front; cannot be combined with the state 'minimized'. If false, brings the next window in the z-order to the front; cannot be combined with the state 'fullscreen' or 'maximized'.
In background.js :
Better just call chrome.windows.update with {'focused': true} if --focused is set. Dont know why, but at least in windows, now put the focus in a "random" window even with --focused not set.
Regards
Edit : I think that the problem is that if you set the focused to false it returns the focus to the last focused window. So better to not send a focused false.
Edit2: From the documentation: https://developer.chrome.com/extensions/windows
(optional) focused : If true, brings the window to the front; cannot be combined with the state 'minimized'. If false, brings the next window in the z-order to the front; cannot be combined with the state 'fullscreen' or 'maximized'.