For some browsers (and depending on settings), links with target = “_blank” seems to open in the foreground, but for a lot of others it seems to open in the background.
In my case opening in the foreground is what a user intends when she/he clicks on the link, so it would be nice if there is a way to ensure that. Is there a way to do this? Thank you.
You can try using window.focus() to bring the new window to the front. You may do it on the opened document, using jquery, with:
or from the original document:
The setTimeout is needed to allow time for the window to be actually created by the browser. There may be a cleaner method to achieve this, but the setTimeout should do it.