是否有可能切换浏览器标签? [英] Is it possible to switch browser tab?
问题描述
下面就是我的要求,
我工作的一个企业应用程序这是相当老了,它仅支持IE浏览器。现在,有一些用户可以从该应用程序中打开多个标签/窗口机会。我写了一个自定义的超时插件我们与的jQuery插件idleTimer 目的。当倒数达到10或小于10,我需要切换到这个标签/窗口,使用户知道该页面获取不到10秒到期。
I'm working on a enterprise application which is quite old, and it supports IE browser only. Now, there are chances that the user could open multiple tab/window from this application. I have written a custom timeout plugin for our purpose with jQuery idleTimer Plugin. When the countdown reaches 10 or less than 10, i need to switch to this tab/window to make the user aware that the page gets expired in less than 10 seconds.
那么,有没有一个解决方案?我曾尝试 window.focus()的
,但不起作用。
So, is there a solution for this? I have tried window.focus()
but does not work.
推荐答案
有没有一个跨浏览器的方式做到切换标签这是100%可靠的,尤其是在新的浏览器。它的积极挡在大多数较新的浏览器。作为用户,我很高兴它在别人困难的在大多数情况下,是不可能做到这一点。
There isn't a cross-browser way do switch a tab that's 100% reliable, especially in newer browsers. It's actively blocked in most newer browsers. As a user, I'm glad it's difficult in most cases, impossible in others to do this.
这篇关于是否有可能切换浏览器标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!