Is it possible to switch browser tab?

后端 未结 2 891
有刺的猬
有刺的猬 2021-01-27 18:57

Here is my requirement,

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 mul

相关标签:
2条回答
  • 2021-01-27 19:19

    If I understand your question correctly, setting a timeout for a Javascript alert in one page then move to another tab, the alert appearing after the timeout will trigger tab switch.

    setTimeout(function(){ 
        alert("Switched tabs");
    }, 
    5000);
    
    0 讨论(0)
  • 2021-01-27 19:28

    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.

    0 讨论(0)
提交回复
热议问题