I'm developing web pages using only under google chrome browser.
For example, my page is opened in a tab called MyTab.
And some times, the user is viewing a page in an other tab OtherTab.
Now, I want to trigger an activation on MyTab.
Then I tried:
<script>
// MyTab
setTimeout(function() {
alert('activated');
}, 5000);
</script>
This do works, the MyTab page pops to the front.
Problem:
But I don't want to produce an alert();
Then I tried to call window.focus()
:
<script>
// MyTab
setTimeout(function() {
window.focus();
}, 5000);
</script>
But with no luck. It seems the window.focus()
method do not work.
Then I tried to find the problem: window.focus() not working in Google Chrome
But it don't quite points out to a solution for me.
So, is there any way to pop the window tab to the front, with out using alert()
?