Is there a reliable way to open a new window in JavaScript and keep focus on the current window, provided we can have code in both windows? If not possible in all browsers, then being able to do it in some at least, would still be useful.
I have tried the following :
1.
var handle = window.open(...);
handle.blur();
window.focus();
In the opened window that should lose focus :
window.addEventListener('load', (event) => {
window.blur();
window.opener.focus();
});
But it doesn't seem to work in Chrome, Safari and Firefox.