I am writing browser extensions for both chrome and firefox, and I am having a trouble finding how to focus a browser window that is currently out of focus but contains a tab that I want to focus.
Focusing a tab can be done when the browser window has focus. However, the browser window does not e to focus when I focus a tab inside it.
To make it clearer,
I have two chrome browser windows open, each containing multiple tabs. One of the window has a focus, and the other window contains a tab that I want to focus and show to the user. Though I can focus the tab so that it es on top of other tabs, the browser window does not e on top of other browser windows.
I wonder if such API is available?
I am writing browser extensions for both chrome and firefox, and I am having a trouble finding how to focus a browser window that is currently out of focus but contains a tab that I want to focus.
Focusing a tab can be done when the browser window has focus. However, the browser window does not e to focus when I focus a tab inside it.
To make it clearer,
I have two chrome browser windows open, each containing multiple tabs. One of the window has a focus, and the other window contains a tab that I want to focus and show to the user. Though I can focus the tab so that it es on top of other tabs, the browser window does not e on top of other browser windows.
I wonder if such API is available?
Yes, in Firefox you have BrowserWindow.activate()
.
In Chrome you have chrome.windows.update(windowId, {focused: true})