Open new window without focus on it [duplicate]

What you seek is called a “pop-under” window

  • Open a new window using let handle = window.open()
  • Lose focus of the new window by using handle.blur()
  • The return focus to your existing window using window.focus()

Example:

var handle = window.open('https://stackoverflow.com/');
handle.blur();
window.focus();

However, it’s not a guarantee as user browser settings may override this behavior, especially pop-up blockers.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)