I am using the following code to open a maximized pop up window, i don't want to open it full screen (F11), I need it just maximized, exactly like pressing the button between minimize and close.
<a onclick="javascript:w= window.open('https://www.facebook.com/mywifemylove','_blank','channelmode =1,scrollbars=1,status=0,titlebar=0,toolbar=0,resizable=1');" href="javascript:void(0);" target="_blank">Maximized on Chrome</a>
It's working fine for all browsers but not Chrome, Here is a jsfiddle for testing
With the exception of IE, browsers do not support going fullscreen with JS. This is intentional:
https://developer.mozilla.org/en-US/docs/Web/API/window.open#FAQ
"All browser manufacturers try to make the opening of new secondary windows noticed by users and noticeable by users to avoid confusion, to avoid disorienting users."
You can manually set the size of the window to the screen size but you may have to deal with things like frame border thickness.
Relevant SO question: How to open maximized window with Javascript?
Working code for max size window on latest versions of IE, FF or Chrome:
window.open('http://www.stackoverflow.com','_blank','height='+screen.height+', width='+screen.width);
You can open window tab with below code:-
window.open(src, "newWin", "width="+screen.availWidth+",height="+screen.availHeight)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With