I need to open a new window in the background with JavaScript, and make sure the original is still focused

This is known as a ‘pop-under’ (and is generally frowned upon… but I digress).. It should give you plenty to google about

You probably want to do something like:

var popup = window.open(...);
popup.blur();
window.focus();

Which should set the focus back to the original window (untested – pinched from google). Some browsers might block this technique.

Leave a Comment