I'm trying to open new windows in the background in Google Chrome version 62.0.3202.94. I run the code by typing in Notepad and copy-pasting into F12 Developer Console.
This is the code I've tried so far, adapted from various Google search results:
var url = "https://stackoverflow.com/";
function test1(){
var w = window.open(url);
w.blur();
window.focus();
}
function test2(){
window.open(url);
window.open().close();
}
function test3(){
window.open(url, "s", "width= 640, height= 480, left=0, top=0, resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no").blur();
window.focus();
}
And I typed test1()
and test2()
and test3()
and hit Enter without achieving what I desired: The new page just opens and acquires the focus.
Any chance I could do that?
Note the emphasis on browser and version.