admin管理员组文章数量:1415476
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?
Share Improve this question asked Sep 27, 2013 at 1:34 JoonJoon 9,9248 gold badges51 silver badges75 bronze badges1 Answer
Reset to default 5Yes, in Firefox you have BrowserWindow.activate()
.
In Chrome you have chrome.windows.update(windowId, {focused: true})
本文标签: javascriptHow to force focus a browser window using browser extensionpluginStack Overflow
版权声明:本文标题:javascript - How to force focus a browser window using browser extensionplugin? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745171766a2646017.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论