<p>Is it possible to launch a new window in JavaScript using the window.Open function, then set the focus to that tab?</p>

<p>Here's what I'm doing today:
<code></p>

<pre>
            var winRef = window.open(outUrl,wName,'left='+ wX +',top=' + wY + ',height=' + wH + ',width=' + wW + args);
            try {
                // Not all window types support the focus() property.
                winRef.focus();
            }
            catch (exception) {
            }
</pre>

<p></code></p>

<p>The window opens, but the new tab doesn't receive focus.</p>

[{'answer_id': 72971, 'author': 'jtimberman', 'author_id': 7672, 'author_profile': 'https://Stackoverflow.com/users/7672', 'pm_score': 1, 'selected': False, 'text': '<p>As a user, I never want applications (or tabs) to take focus unless I specifically requested it. I have gone to great lengths to prevent tabs in my browser (Firefox) from taking focus for this reason. </p>\n'}, {'answer_id': 72997, 'author': 'Guido', 'author_id': 12388, 'author_profile': 'https://Stackoverflow.com/users/12388', 'pm_score': 3, 'selected': True, 'text': '<p>Jay,</p>\n\n<p>You are seeing designed behavior.  To limit opportunities for malicious behavior, scripts running in tabbed windows cannot affect other tabs.</p>\n\n<p>For more information, please see Tabbed Browsing for Developers at <a href="http://msdn.microsoft.com/en-us/library/ms537636.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms537636.aspx</a> :</p>\n\n<p>"The ability to open multiple documents within the same browser window has certain practical and security implications [...] Active tabs (tabs with focus) cannot be affected by scripts that run in inactive or background tabs."</p>\n\n<p>BR.</p>\n'}, {'answer_id': 73005, 'author': 'Erratic', 'author_id': 2246765, 'author_profile': 'https://Stackoverflow.com/users/2246765', 'pm_score': 1, 'selected': False, 'text': "<p>I'm reasonably certain you can't shift focus to another tab.</p>\n\n<p>My understanding is this is done to somewhat limit pop ups and other malicious content from stealing the users focus. </p>\n"}, {'answer_id': 78119, 'author': 'Brendan Kidwell', 'author_id': 13958, 'author_profile': 'https://Stackoverflow.com/users/13958', 'pm_score': 1, 'selected': False, 'text': '<p>If the other "tab" is part of your application (and not content from another site) perhaps you should include it in a popup div on top of your main content instead of in a separate window; that way you can always control focusing it, deactivating the content under it (for modal dialogs), hiding it, etc.</p>\n'}, {'answer_id': 547019, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': "<p>As a user, shouldn't I be able to control how this operates?</p>\n\n<p>What if there is an application that would be enhanced by this feature that I want to run - shouldn't I be able to grant a domain that privilege?</p>\n\n<p>Just a thought.</p>\n"}]
['https://Stackoverflow.com/questions/72943', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/733/']